import lxml.html as LH
xmlspec = "<?xml version='1.0' encoding='iso-8859-1'?>"
a = LH.fromstring(xmlspec + "<html><body><p>Body</p></body></html>")
b = LH.fromstring(xmlspec + "<html><meta /><body><p>Body</p></body></html>")
print a # says element p while I would have expected html
print b # says element html which is expected