Thanks, that's it! Now it works, but only with the code to export one only txt file with the content of all xml's:
use XML::Twig;
my $xml_dir = 'C:\xmlperl';
my $cnt = 0;
my $out;
opendir(DIR,$xml_dir) || die;
my @TranscriptsList = grep(/xml$/, readdir(DIR));
closedir(DIR);
foreach...