#!/usr/bin/env perl use strict; use warnings; use XML::LibXML; my $dom = XML::LibXML->load_xml (string => <<'EOT');
item_a item_b
EOT my $object11 = $dom->findnodes ('/header/idset'); my @attrs = $object11->shift->attributes; print "@attrs\n";