from lxml import etree
from io import StringIO
t = etree.parse(StringIO(
    """<body>
<h1>A title</h1>
<p>Some text</p>
</body>"""))
root = t.getroot()
for child in (root.iterdescendants(),):
    pass
Equivalent to InnerHTML when using lxml.html to parse HTML