Performance enhancement, added support for lxml, if present