Better parsing. Step one towards preprocessing the XML