`data = lxml.html.tostring(document, encoding='unicode')` here, too.