Fix extra root tags being added by lxml

This PR fixes the extra <div></div> root element being added by lxml when DEMOTE_HEADERS is enabled.

I think the lines 450-452 can safely be removed without any side-effects, as the `strip_root_element()` function takes care of that.