in reply to Decoding UTF-16 to ASCII

Using a CPAN module for parsing XML is a good idea.

XML::Simple is really simple to use. Just:
use XML::Simple; use Data::Dumper; my $xml_hashref = XMLin($file); print Dumper $xml_hashref; #Just to see how it is structured

Then, you can iterate over the hasref, and translate one space into no-space, and two spaces into one:

$xml_hashref->{tag1}->{nested_tag}{value} =~ s/\s//gs


This node describes how to iterate hashrefs.