The context of the visit is important: in just a few weeks, Kim will meet South Korean President Moon Jae-in for the first time. Soon after that, he will sit down with US President Donald Trump for the first ever meeting between sitting American and North Korean leaders.The meeting comes not long after both Kim and Xi have successfully consolidated power at home — Xi by having term limits abolished and effectively becoming president-for-life; Kim through the likely successful development of a nuclear deterrent.North Korea has been a thorn in China's side in recent years. Beijing is concerned that North Korean provocations could restart hostilities with South Korea and the United States. By making North Korea less reliant on Chinese protection, Pyongyang's nuclear program reduces China's ability to influence North Korean policy.Nevertheless, North Korea has few friends and it would be a sign of disrespect to meet with his formal enemies — the Korean War never formally ended — before meeting with his formal ally.KCNA, North Korea's state news agency, reported that Kim toasted Xi by saying: "It is appropriate that my first trip abroad is in China's capital, and my responsibility to consider continuing North Korea-China relations as valuable as life."It is possible that this visit's purpose is nothing more than to show Seoul and Washington that China and North Korea remain friends and that China's concerns must not be ignored in subsequent negotiations. But it is more likely part of a cunning strategy on the part of Kim Jong Un.China's Xinhua news agency reports that Kim told Xi: "It is our consistent stand to be committed to denuclearization on the peninsula."This seems like an important statement because it will both show Trump that denuclearization is on the table — making it less likely that the US finds a way to back out of talks — and makes it highly unlikely that Kim will reverse himself with Moon or Trump, which would be a sign of disrespect to Xi.But, alas, these matters are never so simple. What Kim means by "denuclearization on the peninsula" is unlikely to mean the unilateral disarmament of North Korea, to which Kim will probably never agree.Kim went on to say: "The issue of denuclearization of the Korean Peninsula can be resolved, if South Korea and the United States respond to our efforts with goodwill, create an atmosphere of peace and stability while taking progressive and synchronous measures for the realization of peace." This statement could easily mean that Kim interprets "denuclearization on the peninsula" as the withdrawal of the US nuclear umbrella and perhaps the withdrawal of American forces as well.Kim is no doubt aware of Trump's many statements, over a period of years, denigrating the US-South Korea alliance. He has complained that South Korea does not pay the US enough protection money and that Seoul takes advantage of the US. It is possible that Kim sees an opportunity to get Trump to agree to a withdrawal of United States Forces Korea in such a way that Trump can claim a major victory. And while Trump may be able to claim victory, the real winners would be North Korea and China.This strategy may be clever, but it is not without risk. Kim has no reason to trust the United States — after all, he knows what happened to Libya and Ukraine. But he may believe that Trump's desire for a "win," combined with his utter disregard for US alliances and complete ignorance of the region, makes him an easy mark.But with the appointment of John Bolton as the new national security adviser — whose goal is not only denuclearization, but regime change — and Trump's past talk of "fire and fury," it could be that the Trump administration is angling for a failure and an excuse for war.And stuck in the middle is Moon, who needs to avoid both an unnecessary war and a destabilizing withdrawal — and do so without alienating China or antagonizing Trump.The hall is rented, the orchestra engaged. And in a matter of weeks, we'll know if the players can dance.