use strict; use warnings; use XML::Simple qw( :strict ); my $xml = 'blah&blah'; my @opts = (KeepRoot=>1, KeyAttr=>[]); my $data = XMLin($xml, ForceArray=>1, @opts); use Data::Dump; dd($data); print(XMLout($data, @opts));