xml.etree.ElementTree.ParseError: not well-formed (invalid token) in Python
Question: I am trying to open an XML file using `ElementTree` but an error occurred:

> xml.etree.ElementTree.ParseError: not well-formed (invalid token)

And here is my code:

    
    
    # -*- coding: utf-8 -*-
    import xml.etree.ElementTree as etree
    
    def main():
        tree = etree.parse('test.xml')
        print 'parsing Success!'
    
    if __name__ == "__main__":
        main()
    

How can I fix this error?


Answer: The [XML format rules](http://www.w3schools.com/xml/xml_syntax.asp) state that
you have to have one root element. Your document has two of them, `pdml` and
`packet`. I'm not familiar with PDML, but a XML parser probably will choke on
that.

