my $xc = XML::LibXML::XPathContext->new($root); $xc->findnodes('/HOSTNAME/PATROL/ACL/USERNAME') $sections->findnodes('./PERMISSION') #### $root->findnodes('/HOSTNAME/PATROL/ACL/USERNAME') $sections->findnodes('./PERMISSION') #### my $xc = XML::LibXML::XPathContext->new( $root ); $xc->findnodes('/HOSTNAME/PATROL/ACL/USERNAME') $xc->findnodes('./PERMISSION', $sections) #### $xc->findnodes('PERMISSION', $section)