my %table; #for my $col_node ( $root->findnodes('//datacolumn') ) { for my $col_node ( $table_node->findnodes('datacolumn') ) { my $col_name = $col_node->getAttribute('name'); $table{$col_name} = [ map $_->getValue(), $col_node->findnodes('item/@value') ]; }