The interesting thing about the nationalist's problem is that the only true answer to it is, paradoxically, internationalism.
The nationalist's concerns are to do with the loss of culture, the blurring of a society's identity, and the removal of a people's agency and self-determination - these are very valid concerns. Liberals are happy to see them as valid concerns when it comes to the third world, when it comes to European or American imperialism. These should be considered valid concerns for all societies.
Capitalism, which by its nature tends towards globalism, removes the agency of a society in general and places power in the hands of a few capitalists. It is in their economic interests to make the whole world a unified market, to import cheap labour, and to export the same commodities all over the world.
Immigrants don't come to Europe or America for the weather; they come for economic conditions. They come for housing, healthcare, education and jobs. They come for social security. We can clearly see that if those needs were met in their homelands, they wouldn't bother to immigrate; hence the way that many of these groups of people don't culturally integrate. They want to still be in Mexico, for example, but with the economic conditions of the USA.
We can also see that these people will travel for these economic conditions whether it is legal or not. They will try anything, to better the lives of themselves and their loved ones, if their homeland is bad enough. The "jungle" in Calais is evidence of this, and only one example of many.
The way to solve these issues once and for all? International socialism. An international situation in which each locality, each society or nation or country - whatever you want to call it - has agency, has control over their own society, and has the quality of life in their own homeland that they want.
Capitalism is global; it must be fought on the global arena. Internationalism is the only way to tackle the problem, or else the problem is merely postponed or passed along. An island of socialism cannot survive long in a sea of capitalism.
If you want a society in which your people have economic and political agency, in which your culture is not sacrificed for profit, and in which all cultures across the world can maintain their uniqueness - then there is no other answer.