Fix py26 bug in xml parser

So in py26 invalid xml raises a SyntaxError.  Updated
the compat module to hide this difference.

Verified all tests pass in py26, py27, and py33.