Hello Samuel,
You would like to generate a XML-file on a filesystem?
First execute your query (use sql atom) and then process the result to your XML-format. (XSLT Transformation).
Then call the "upload file to filesystem" atom for creating the file.
More info you can download on the SAP partner portal, (s-user required) or the help in B1i.
Best Regards Teun