Fix blahtex math engine under Ruby 1.8.7
Fix XML comments issue even for Ruby 1.9.2, whose REXML is even more broken than the others.