Help for this page
open my $out_fh, '>', $file; print {$out_fh} $doc->toString;
use warnings; use strict; ... close $fh; $doc->toFile('/tmp/two.xml');