Xi is gonna wait until the coming battle of Ukraine is finished and it won't end well for the Russians. America left Vietnam, Iraq and Afghanistan, largely driven out, Vlad will have to swallow really fucking hard and take it up the ass.
If China helps Russia and extends the war, it will be to weaken and destabilize Russia, not harm Ukraine. China is risking everything if it casts its lot in with Russia, but they will support and profit from them in other "legal" ways. A weak Russia is to China's advantage and a breakup of the Russian empire would mean unimagined opportunities for them in eastern Asia, not very many ethnic Russians live there. They are already cutting deals and building railways into the oil and gas rich stans in western central Asia. Russia needs to worry about its own dissolution and China a lot more than it needs to worry about Ukraine and NATO. However, having Slavic liberal democracies on its European doorstep where 80% of Russians live and the spread of liberal democracy is also fatal to the empire.