applied fundamental changes to lxml handling