XmlParser now handles whole XML documents.

Previously, XmlParser only handled XML content. It now also handles
complete XML documents, including for example XML version and encoding
header.