I think this is a bug in XML::DOM. A work-around is to print to a string and then output it yourself with the correct I/O layers in place:
my $doc = $parser->parsefile("$srcdir/$_");
my $output = $parser->toString;
open(my $out, ">:utf8", "$dstdir/$_") or die "...";
print $out $output;
close($out);