I usually find the CPAN documentation adequate though you do have to read several modules: XML::LibXML::Element, XML::LibXML::Node etc. A separate issue is that your documentation problem may be with XPath and not XML::LibXML. I find http://www.w3schools.com/Xpath/ quite helpful in this regard. The real gotcha however is very often that when you try to parse a wild piece of XML, it often has a namespace set.
The following example I have just grabbed out of some code of mine.
my $parser = XML::LibXML->new();
my $doc = $parser->parse_string($xml_sitemap);
print $doc->getDocumentElement->getNamespaces->getValue, "\n";
my $xpc = XML::LibXML::XPathContext->new();
$xpc->registerNs('x', $doc->getDocumentElement->getNamespaces->getValu
+e);
foreach my $u ($xpc->findnodes('//x:loc/child::text()',$doc)) {
my $url = $u->toString;
.......
}
|