By Noah Barkin and Elizabeth Piper

DAVOS, Switzerland (Reuters) - Chinese President Xi Jinping offered a vigorous defence of globalisation and free trade in a speech at the World Economic Forum in Davos on Tuesday, which underscored Beijing's desire to play a greater global role as the United States turns inward.

Likening protectionism to "locking oneself in a dark room" to protect from danger, but at the same time depriving the room of "light and air", he cautioned other countries against pursuing their own interests at the expense of others.

Xi did not mention Donald Trump in his speech of nearly an hour but many of the messages he sent seemed directed at the U.S. president-elect, who campaigned for the White House on pledges to protect U.S. industries from foreign competition and levy new tariffs on goods from China and Mexico.

"No one will emerge as a winner in a trade war," Xi told the forum in the Swiss Alps.

He said economic globalisation has become a "Pandora's Box" for many, but that it was not the cause of many global problems. He added that international financial crises were caused by the excessive pursuit of profits, not globalisation.

Xi's appearance, a first for a Chinese leader at the annual meeting of political leaders, CEOs and bankers in Davos, came as doubts emerge about whether the United States will remain a force for multilateral cooperation on issues like trade and climate change.

Europe, meanwhile, is pre-occupied with its own troubles, from Brexit and militant attacks to the string of elections this year in which anti-globalisation populists could score gains.

This has left a vacuum that China seems eager to fill.

"It is no coincidence that Xi chose this year to make the trip up the magic mountain," said Ian Bremmer, president of Eurasia Group, a U.S.-based political risk consultancy.

More than half a dozen senior Chinese government figures are in Davos this week, far more than in past years. And a large number of sessions are focused on Asia, including one entitled "Asia Takes the Lead".

WEF founder Klaus Schwab said Xi's presence was a sign of the shift from a uni-polar world dominated by the United States to a more multi-polar system in which rising powers like China will have to step up and play a bigger role.

"In a world marked by great uncertainty and volatility the world is looking to China," Schwab said before Xi spoke.

(Additional reporting by Ben Hirschler; Editing by Pravin Char)