How to get an XML element tree from a string in Python

XML documents have a hierarchical structure which can be interpreted as a tree structure. Getting an xml.etree.ElementTree from a string parses a string representing this tree structure into an ElementTree.

Solution for How to get an XML element tree from a string in Python : You can use xml.etree.ElementTree.fromstring() to get an XML tree from a string Call xml.etree.ElementTree.fromstring(string) to convert string to an ElementTree.


how-to-get-an-xml-element-tree-from-a-string-in-python