for my $node ($dom->findnodes('/osm/node')) { my $tag = $node->findnodes('tag[@k="name"]')->[0]; print $tag,"\n"; my $key = "$node->{lat}.$node->{lon}"; if (exists $HoH{$key}) { print "Matching key found for $key with id $HoH{$key}->{id}\n"; # Do something useful with it here } }