in reply to XMLOut in XML::Simple returning unwanted xml format

You can use KeyAttr=>{Item1=>'name'}

use XML::Simple; use Data::Dumper; my $hash= { 'root' => { 'item1' => { 'item1a' => 'n1', 'item1b'=>'jh' } } }; my $xs = new XML::Simple( ); my $xml = $xs->XMLout($hash, NoAttr => 1, RootName=>undef, KeyAttr=>{I +tem1=>'name'} ); print Dumper $xml;

Or you do what haukex said

Replies are listed 'Best First'.
Re^2: XMLOut in XML::Simple returning unwanted xml format
by perl_help27 (Acolyte) on May 22, 2018 at 18:39 UTC
    This was actually what I needed since it was just a simple map needed.Thank you!