Try doing this :
#!/usr/bin/perl -w
use strict;
use warnings;
use Data::Dumper;
use XML::Simple;
my $xml1 = new XML::Simple;
my $data1 = $xml1->XMLin( '
<aaa>
<bbb>
<id>1</id>
<text>Test 1</text>
</bbb>
</aaa>
',
ForceArray=>['bbb']
);
print Dumper($data1);
From perldoc XML::Simple :
ForceArray => 1 # in - important
This option should be set to '1' to force nested elements to be represented as arrays even when there is only one.This option is especially useful if the data structure is likely to be written back out as XML and the default behaviour of rolling single nested elements up into attributes is not desirable.