Each XML element is represented by an instance of the Element class.
See Section 8.1, “Attributes of an Element instance” for
attributes of an Element instance in the
Python sense, as opposed to XML
attributes.
See Section 8.2, “Accessing the list of child elements” for the various ways to access the element children of an element.
The various methods on Element instances
follow in alphabetical order, starting with Section 8.3, “Element.append(): Add a new element
child”.
Each instance of the Element class has
these attributes.
.tag
The element's name.
.attrib
A dictionary containing the element's attributes. The keys are the attribute names, and each corresponding value is the attribute's value.
.tail
The text following this element's closing tag, up
to the start tag of the next sibling element. If
there was no text there, this attribute will have
the value None.
This way of associating text with elements is not
really typical of the way most XML processing
models work; see Section 2, “How ElementTree represents XML”.
.text
The text inside the element, up to the start tag of
the first child element. If there was no text
there, this attribute will have the value None.