while ( ch != '>' )
perhaps?