Nick,
>Yep, I thought abount that but it sounds an awfully inefficient solution, writing these tags thousands of times and then going through and replacing each and every one of them. Then, of course, there is the problem of what happens if the data contains the same text as one of the field names!
It would certainly be risky to use the STRTRAN, as you mention, although you could avoid the problem with data/fieldnames conflicting by including the angle brakets (complete tag and endtag strings) in your STRTRAN expressions. The XMLField renaming solution I posted is sort of klunky, but it will get the job done.