PyDocs

Nav

Structured Markup Processing Tools

indent

xml.etree.ElementTree

function · Added in 3.9 (source)
  • indent(tree, space=' ', level=0)
Indent an XML document by inserting newlines and indentation space
after elements.

*tree* is the ElementTree or Element to modify.  The (root) element
itself will not be changed, but the tail text of all elements in its
subtree will be adapted.

*space* is the whitespace to insert for each indentation level, two
space characters by default.

*level* is the initial indentation level. Setting this to a higher
value than 0 can be used for indenting subtrees that are more deeply
nested inside of a document.
0 Examples
No examples for xml.etree.ElementTree/indent.
See Also
No see-alsos for xml.etree.ElementTree/indent
0 Notes
No notes for indent