in reply to PERL newbie question

This might help you get started. If you can provide the actual XML data it will be easier to help further. Please note this code is UNTESTED!

use feature ":5.14"; use warnings FATAL => qw(all); use strict; use Data::Dump qw(dump pp); use XML::Simple; sub readUnicode($) {my ($f) = @_; open(my $F, "<:encoding(UTF-16)", $f) or die "Cannot open $f for uni +code input"; local $/ = undef; <$F>; } sub writeUnicode($$) {my ($f, $s) = @_; open(my $F, ">:encoding(UTF-16)", $f) or die "Cannot open $f for uni +code output"; say {$F} $s; } my $x = XMLin(readUnicode("some file containing XML")); $x->{foo}{bar} = "new value"; my $X = XMLout($x); writeUnicode("output file name", $X);