China does not offer visa on arrival unless prearranged, but twov is SOP at all airports receiving international flights.
I don't understand why anyone would stick around xmn for 5 hours (more than enough time to get out and go somewhere interesting).