Foreign loans.

Many governments take foreign loans. Are these loans beneficial for gross domestic product? Why, or why not?