use XML::Bare;
use Data::Dumper;
use 5.010;

my $doc = XML::Bare->new(file=>'sample.xml', keeproot=>0)->simple;
my @keys = keys %{$doc};
$doc = $doc->{$keys[0]};
if (exists $doc->{SelectResult}{Item} && ref $doc->{SelectResult}{Item} ne 'ARRAY') {
  $doc->{SelectResult}{Item} = [ $doc->{SelectResult}{Item} ];
}
say Dumper($doc);

