Xi made the comments as he met with Abu Dhabi Prince Sheikh Khaled bin Mohamed bin Zayed Al Nahyan in Beijing, where he outlined proposals for maintaining peace in the Middle East and Gulf.
A first round of discussions between Iran and the United States held in Pakistan over the weekend failed to produce a deal, with US Vice President JD Vance proclaiming the ball was now in Iran's court to end the war.
"Xi Jinping stressed China's principled stance of promoting peace and urging talks, and reiterated it will continue to play a constructive role on this," state news agency Xinhua said.
His comments were part of four proposals he put forth as a way to promote peace in the Middle East, according to state broadcaster CCTV.
"The sovereignty, security and territorial integrity of the Gulf countries in the Middle East should be sincerely respected," Xi said.
"Safeguarding the authority of international rule of law cannot mean 'use when it suits, lose when it doesn't," he added.
While he did not elaborate in detail, Xi also stressed the need to safeguard a UN-based world order, and coordinate on security and development issues.
The Abu Dhabi royal is one of several leaders from countries impacted by the Middle East war to visit Beijing this week.
Vietnam's To Lam and Russia's Foreign Minister Sergei Lavrov also touched down in the Chinese capital on Tuesday, hoping to boost cooperation on the conflict, as well as bilateral issues.
The Russian foreign ministry has said Lavrov and China's top diplomat Wang Yi would discuss the situation in the Middle East during their meeting, which follows a call this month during which the pair agreed to work together to deescalate tensions.
Spanish Prime Minister Pedro Sanchez is also visiting Beijing this week, for a trip largely focused on bilateral trade ties.
Nevertheless, Sanchez told reporters on Tuesday that China can play an "important role" in the Middle East.