in reply to Specifying filename

What does
can't get the value of $filename into that path ... or something like that
mean?

Change

open (XMLFILE,">c:/Perl_Tests/".$filename.".xml");
to
my $path = ">c:/Perl_Tests/".$filename.".xml"; open (XMLFILE, $path) or die "Opening $path : $!";
Then you can see what error ($!) caused the open to fail (as well as the path that was used).

You should also add use strict; use warnings at the top of your program.