use XML::Simple; my $xs = XML::Simple->new; my $AdXML = $xs->XMLin($adfile, ForceArray=>1, RootName=>'AdXML');