Islam was introduced to China by Arab traders during the Tang Dynasty: which is considered by many to be a golden age in China’s history. The Muslims who settled in China married the local Han Chinese in the area. The Great Mosque was built to honour the founding fathers of Islam in China.
I’m relatively familiar with history of the Uyghur Community in Xinjiang Province – since it’s covered in the news a fair bit – but I was largely unaware of the Hui People of Xi’an. But ignorance is nothing that a bit of light reading and personal experience can’t fix. The origin of the Hui People is believed to have started on the Silk Road as a result of the intermarriage between Muslim traders and Han Chinese.