#!/usr/bin/perl use strict; use warnings; use XML::LibXML; my $parser = XML::LibXML->new; my $tree = $parser->parse_file( 'test.xml' ); my @nodes = $tree->findnodes( '/offer/offerstatus[@resolution="day"]/timerange/pstart' ); for my $node ( @nodes ) { print $node->textContent,"\n"; }