Buying China train tickets is a pain right in the rear if you ask me... The only way I know of to buy of in advance is tripadvisor.com, or be in the city of departure 10 days in advance which is generally when they go on sale. They really need to make their system more user/tourist friendly. I would think the Xian-Beijing route would go on sale 10 in advance. Some routes are only 3 or 5 days in advance. I just recently was trying to buy a ticket for a friend 4 days in advance and was told "tickets don't go on sale for that train until tomorrow..." I called back the next morning and they said the train was sold out....