##
open my $out_fh, '>', '/path/to/output_file';
####
my %doc_fh_for = (File0 => \*FILE0, File1 => \*FILE1, File2 => \*FILE2);
####
my %source_file_for = (File0 => 'filename0', File1 => 'filename1', File2 => 'filename2');
####
for (@feature_files) {
open my $in_fh, '<', $source_file_for{$_};
write_xml_content($_, $in_fh, $out_fh, ' ' x 8);
close $in_fh;
}