#!/usr/bin/perl use strict; use warnings; use XML::XSH2; use Data::Dumper; xsh << 'end.'; open 1.xml ; $h := hash ../../../Seller/@sellerIdFromProvider /DataFeed/SellerInformation/TaxableLocationsCollection/TaxableLocation/@locationValue ; end. $_ = [ map $_->getValue, @$_ ] for values %$XML::XSH2::Map::h; # Convert attributes to strings. print Dumper($XML::XSH2::Map::h);