added lxml support based on: http://lxml.de/tutorial.html