#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use XML::LibXML; my $xml = 'XML::LibXML'->load_xml(location => 'file.xml'); for my $place ($xml->findnodes('/xml/Document/Folder/Place')) { print $place->findvalue('Name'), "\t"; my $name2 = $place->findvalue('ExtendedName/Data[@name="NAME_2"]'); say $name2; } #### $scratch/> open file.xml parsing file.xml done. /> for /xml/Document/Folder/Place echo (Name) ExtendedName/Data[@name="NAME_2"] Location 1 Salt Lake City Location 2 Providence Location 3 Green Bay Location 4 Casper