my $parser = XML::LibXML->new(); my $doc = $parser->parse_file($data); my ($object) = $doc->findnodes("\/e\/p\[\@v=\"YES\"\]");