President Trump and China’s leader, Xi Jinping, exchanged pleasantries and also tackled areas of contention like Taiwan and trade.