You're right. Those villagers were pretty fickle, and I didn't like the way they were so disloyal to Yang LuChan. However, anyone who knows even a modicum of history could understand why the Chinese would be just a tad xenophobic.
The short version is that they allowed outsiders to use their invention (gunpowder) as a means to enslave their country centuries later. A simple Google search of the Opium Wars and the "Century of Humiliation" would show that the Chinese were subjected to the forced acceptance of heroin, unfair trade laws, etc and only regained their independence as a result of WWII (as did India). Nonetheless, the long term effects are still ongoing. Despite extreme measures during the Mao Revolution to curb drug use, it is still a major epidemic in China even to the present day.
Knowing the history, wouldn't you be a bit distrustful (maybe even resentful) of outsiders, too?
I am not saying there should have been an anti-outsider, but it is white washing when you ignore all of the insider corruption. It is like trying to cure your cancer by blaming the cigarette companies...they are horrible, but until you actually remove you cancer nothing will happen. I am extremely environmental, but movies like Avatar just bugged me with the bad outsider causing the problems, this touched that same nerve. The bad guy needs to be developed, and not just a bad guy. This was like Shaolin Soccer with its bad guys, but Shaolin was done that way because it is so absurd to have a "Team Evil"...or a "Dr. Evil".