in reply to Yet another XML::Simple question!
Although you may be best following ikegami's advice and altering your structure, you can in fact get it to output exactly as you want from your existing structure with:
Which may or may not be uglier than you expected.my $xml_obj = XML::Simple->new( Keeproot => 1, GroupTags => {phonenumbers => phonenum +ber}, KeyAttr => [-name] );
/J\
|
|---|