Chinese leader Xi Jinping urges US President Donald Trump to avoid rhetoric that could inflame tensions with North Korea as an escalating war of words raised global alarm.