in reply to Replace xml first id

In a XPath Expression, bare id means "element named id", attributes start with the at-sign (already noted by Corion):
say 'id: ', $object11->findvalue('@id');

But with XML::LibXML, you can get to an attribute value by a shortcut: you can pretend the element is a hash reference and ask for a key:

say 'id: ', $object11->{id};

In xsh, the whole program can be shortened to

open test.xml ; cd header/idset ; echo (a) ; echo (b) ; echo @id ;

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]