It's not enough to just use the XML parser, we also have to make sure the DOM document we produce is an actual XML document. Fixes #5966