my $simple = XML::Simple->new( KeepRoot=>1, #I usually keep the root. KeyAttr=>[], #do not use attributes as hash keys ForceArray => 1 #force array wrapping to keep order );