docinfo
Information about the document provided by parser and DTD. This
value is only defined for ElementTree objects based on the root node
of a parsed document (e.g. those returned by the parse functions),
not for trees that were built manually.

parser
The parser that was used to parse the document in this ElementTree.

__new__(T,
S,
...)

find(self,
path,
namespaces=None)

Finds the first toplevel element with given tag. Same as
tree.getroot().find(path).

The optional namespaces argument accepts a
prefix-to-namespace mapping that allows the usage of XPath
prefixes in the path expression.

findall(self,
path,
namespaces=None)

Finds all elements matching the ElementPath expression. Same as
getroot().findall(path).

The optional namespaces argument accepts a
prefix-to-namespace mapping that allows the usage of XPath
prefixes in the path expression.

findtext(self,
path,
default=None,
namespaces=None)

Finds the text for the first element matching the ElementPath
expression. Same as getroot().findtext(path)

The optional namespaces argument accepts a
prefix-to-namespace mapping that allows the usage of XPath
prefixes in the path expression.

getiterator(self,
tag=None)

Returns a sequence or iterator of all elements in document order
(depth first pre-order), starting with the root element.

Can be restricted to find only elements with a specific tag
(pass tag="xyz" or tag="{ns}xyz") or from a namespace
(pass tag="{ns}*").

You can also pass the Element, Comment, ProcessingInstruction and
Entity factory functions to look only for the specific element type.

Deprecated:
Note that this method is deprecated as of
ElementTree 1.3 and lxml 2.0. It returns an iterator in
lxml, which diverges from the original ElementTree
behaviour. If you want an efficient iterator, use the
tree.iter() method instead. You should only use this
method in new code if you require backwards compatibility
with older versions of lxml or ElementTree.

iterfind(self,
path,
namespaces=None)

Iterates over all elements matching the ElementPath expression.
Same as getroot().iterfind(path).

The optional namespaces argument accepts a
prefix-to-namespace mapping that allows the usage of XPath
prefixes in the path expression.

relaxng(self,
relaxng)

Validate this document using other document.

The relaxng argument is a tree that should contain a Relax NG schema.

Returns True or False, depending on whether validation
succeeded.

Note: if you are going to apply the same Relax NG schema against
multiple documents, it is more efficient to use the RelaxNG
class directly.