use strict; use warnings; use XML::Simple; my $str = < EOL my $ref = XMLin($str); open FH, ">", "webcams.xml" or die ("open failed"); print FH XMLout($ref, AttrIndent => 1, xmldecl => ''); close FH or die ("close failed"); __END__