Xenophobia in chinese history is way more endemic than you make it seem. The pushback against central asiatic people like tibetans and "eastern turks" (i.e: Uighurs) was almost entirely based on race. Or that despite being completely accultured to chinese civilization and not having any cultural links whatsoever to their steppe past (which was pretty tenuous to begin with, as the jurchen were way more settled than their mongol relatives) the overthrow of the Manchu dynasty was portrayed as an act of rebellion against "foreign" domination. Not to mention the way northern chinese looked down on southern chinese as uncivilized barbarians and commented negatively in their historical records on matters such as their darker skin colour. The idea that "white"=noble and rich was present in China and India long before european contact, and for the same reasons (labourers being exposed to the sun, elite class not deigning to partake in "peasant" duties as a sign of superiority).
The chinese were colonialists, despite the constant refrain of being a country closed in on itself. That only became true for a very short time when they were being dominated by european navies. Their strategy was more in the russian style, annex a piece of land and it's people near your borders and drown them in immigrants until their ethnicity and culture is nothing more than a minority. A strategy that is still commonly in use. The resurgence of xenophobia in the 17th century was practically a tradition in chinese history, not a unique occurance brought on by contact with europeans.
As for slavery:
http://en.wikipedia.org/wiki/Slavery_in_Mauritaniahttp://www.globalpost.com/dispatch/news ... man-rightsThese things are always portrayed as "time-honoured traditions" by their practitioners. They are legacies of a past that is endemic to humanity as a whole. I don't frankly see much moral difference between oldschool xenophobia and the more modern variants.