#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use XML::LibXML; my $dom = 'XML::LibXML'->load_xml(location => 'imgfile.xml'); say 'XML Version is: ', $dom->version; say 'Document encoding is: ', $dom->encoding; for my $image ( $dom->findnodes('/imgfile/images/views/view/nodes/node/properties') ) { for my $property (qw( Description Height Width )) { say "$property: ", $image->findvalue("property[\@type='$property']"); } }