More fixes and tests for the XML parser