Job Recruitment Website - Immigration policy - How did the ethnic minorities in China and the "foreigners" in Xinjiang come from?

How did the ethnic minorities in China and the "foreigners" in Xinjiang come from?

Some of them were captured in the war, and then they stayed. They intermarry with local people and reproduce. Their descendants look like foreigners and China people, and they also retain some living habits and religious beliefs of their ancestors.