Beijing
First of all - do you have a multi-entry visa? If not, end of discussion. You are going no where but the terminal. Second, let me tell you what happened to me. When I arrived from Manila, the transfer desk was closed. To even get to the main terminal I had to exit and reenter. If I had not had a multi-entry visa I would have been SOL. It also took forever to re enter. It felt like all of China was trying to enter the terminal and to top it off one of the security people was making everyone that entered entirely unpack their carry on luggage. It was 2 hours to re enter. Take the 2 1/2 hour layover.