#!C:\PERL\bin\perl.exe use strict; use CGI ':standard'; use XML::Simple; #Variables my $arrays = [qw/subcategory packaging_qty recipe description product paragraph comments channel brand conditionning product_id heading photo/]; my $cat = 'C:\Program Files\Apache Group\Apache2\htdocs\legastronome\XML\Admin\test4.xml'; my $category = XMLin( (join'', $cat), KeyAttr => 1, 'ForceArray' => $arrays); XMLout($category, rootname =>'category', outputfile =>('C:\Program Files\Apache Group\Apache2\htdocs\legastronome\XML\Admin\test4.xml'));