The Perl 5 module HTML::TreeBuilder::LibXML is a libxml based compatible interface to HTML::TreeBuilder, which could be slow for a large document.