Glossary · Phase 7 · Software engineering
ElementTree
Python's standard-library module for reading and writing XML as a tree of elements, each with a tag, attributes and text.
Try it now
Short facts about an element go in attributes; content, and anything that repeats, goes in child elements.
Learn it properly
Reading and writing XML · ElementTree, attributes and text, namespaces, building XML safely, and untrusted input. About 35 minutes.
Other terms from the same lesson
- defusedxml: A small Python package with the same interface as the standard XML parsers that refuses the entity tricks hostile XML files use.
- XML namespace: A URL attached to an XML format's tag names so they can't clash with another format's; ElementTree stores tags as {url}name.
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.