Yeah, I got mine. Fuck all those foreigners whose ancestors didn't get here fast enough.
If you're concerned about the purity of your nation there's no need to be a stereotypical liberal about it either. Allow me to present a policy package that costs the state basically nothing and improves the lives of many not currently within the borders of your state.
1. Move from jus soli to jus sanguinus; no one without a parent who is a citizen of the state automatically becomes a citizen.
2. Any foreigner convicted of any crime gets deported. One may wish to have different visa categories for foreigners of a higher class/who have more money. The big thing is that it be clear that begging, petty theft and homelessness are deportable offences.
3. After five years you can either go home with all the money you paid in taxes/social security minus an actuarial average of your cost to the state or you can stay and forfeit it. South Korea does something roughly similar and it works pretty well at discouraging settlement.
If you're feeling really humanitarian you can allow third generation non-citizen residents over 30 an opportunity to naturalise.
A contracting population is clearly a big problem for the capital class. It's bad for stock and bond holders, employers of labor, politicians, and I guess people who made poor retirement preparations. But I don't buy that it's a problem for workers Joe and Jane Blow. They eventually get cheap, high quality housing, and are more inclined to start a family.
Anyway, I also think the various futurist techno fantasies are wrong. Unless liquid thorium reactors or such-like come online next month we're entering an age of permanently escalating energy and food costs. Technology still runs on energy. The Jetsons future of electric cars and soylent for growing billions is not going to happen. The future for most is bicycles with rice and beans.