xml.etree.ElementTree — XML Manipulation API¶
|Purpose:||Generate and parse XML documents|
The ElementTree library includes tools for parsing XML using event-based and document-based APIs, searching parsed documents with XPath expressions, and creating new or modifying existing documents.
- Parsing an XML Document
- Traversing the Parsed Tree
- Finding Nodes in a Document
- Parsed Node Attributes
- Watching Events While Parsing
- Creating a Custom Tree Builder
- Parsing Strings
- Building Documents With Element Nodes
- Pretty-Printing XML
- Setting Element Properties
- Building Trees from Lists of Nodes
- Serializing XML to a Stream
- Standard library documentation for xml.etree.ElementTree – The standard library documentation for this module.
- defusedxml – A package with fixes for various entity-expansion denial of service vulnerabilities useful for working with untrusted XML data.
- ElementTree Overview – Fredrick Lundh’s original documentation and links to the development versions of the ElementTree library.
- Process XML in Python with ElementTree – IBM DeveloperWorks article by David Mertz.