Xi Jinping has carried out the largest purge of officials from China's Communist Party in a bid to toughen internal discipline.