You could create a .xslt that does the conversion, exporting as xml with Your .xslt as postprocessor
You can write that tagged text to one line (extra field) per record, with 'set field' scriptstepp (calculation), then export that line using a plugin (avoid FM linebreaks) to a file called nnn.xml (You can define .xml when exporting via script)
The BaseElements PlugIn is my first recommendation in generally.
It's free and it covers a lot of other functions you'll need once in a while.
There are about v5 functions for XML-Parsing.