Guilin and nearby Yangshuo are popular destinations for tourists. Guilin is more than 2,000 kilometers away from Beijing, and a train trip takes more than 22 hours, so taking a train isn't the best method of transportation between the two places. The best kind of train that runs on this route is the T train.
There are only four trains (T5, T189, K21 and K157) connecting Beijing and Guilin. Train K21 terminates in Guilin while the other three trains continue to Nanning that is the capital of Guangxi Province and/or Zhanjiang. See Beijing to Guilin/Nanning train search
All the trains have soft sleepers, hard sleepers and a restaurant.
T5 and T189 are faster than K21 and K157, and they are recommended even though they cost a bit more than the other two.
The trains stop at Guilin Station. There actually are two railway stations in Guilin called Guilin Station and Guilin North Station that is far from the city center. The trains don't stop at the Guilin North Station.