Chinese President Xi Jinping is purging top military and political leaders in a campaign aimed at curbing corruption and removing potential rivals.