More robust XML parsing
Merge pull request #1656 from jroper/xml-robustness

More robust XML parsing