Python XML Module
XML processing — ElementTree, parse, fromstring, tostring. This category documents 11 Python xml module entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example. The entries include: xml.etree.ElementTree.parse(), xml.etree.ElementTree.fromstring(), xml.etree.ElementTree.tostring(), xml.etree.ElementTree.Element(), xml.etree.ElementTree.SubElement(), Element.find(), Element.findall(), Element.findtext(), Element.get(), Element.set(), Element.remove(). xml.etree.ElementTree.parse() parses an XML file and returns an ElementTree object. xml.etree.ElementTree.fromstring() parses XML from a string and returns an Element. xml.etree.ElementTree.tostring() serializes an Element to bytes (XML string). xml.etree.ElementTree.Element() creates a new XML element with the given tag and attributes. xml.etree.ElementTree.SubElement() creates a new XML element as a child of the given parent. XML Module belongs to the Text & Regex group alongside Regex Module, Textwrap Module, Difflib Module, Unicodedata Module. You can also search across every category from the search page, browse the complete A–Z index, or try any example in the Python playground.