China has hit back at allegations over its treatment of Uyghur Muslims in Xinjiang by saying its actions in the region are focused on counterterrorism and anti-separatism.