This BAT file will product an XML file that contains a list all files in the current directory (where the BAT file is started from). An example of the output is shown below. The ^ is the trick that allows the echo command to spit out < and > characters, which have special meaning in BAT files (they redirect input and output).

Code:
@echo off
cls
echo ^<files^> > files.xml
for %%i in (*.*) do echo ^<file^>%%i^</file^> >> files.xml
echo ^</files^> >> files.xml
In this example, the BAT file itself (and the files.xml file) will show up in the output. The easiest fix for this is to use specific pattern masks in place of (*.*) in the BAT file so you exlude BAT and XML files.

<files>
<file>file1.pdf</file>
<file>test.bat</file>
<file>whatever.txt</file>
</files>


Sorry, I don't have an AppleScript solution handy but it should be just about as straightforward as the BAT file solution.