Generally, you build out the text export as needed, then "write" it to your XML file. You don't generally include the tags/delimiters in the actual data.
For example, if I have a table named Table1, and I want to export the values in a field named "sName" to a textfile named "TESTFILE.txt" in the currrent database directory, the attached code will do that. You would of course have to modify this to be formatted to your needs.