Complete XML parsing, builds an XML tree.