they are generated as text (read recordsets from a
access database and write them as xml tag to a xml
file)

Well rather than patch up the code to escape ampersands and the other "dodgy"
characters (<, ', ") you can just open an adodb.recordset and save directly to
an xml file, recordset.save(<filename>, 1). It's not a completely
straightforward representation but I've successfully transformed it to many
other formats. I have generic transform somewhere that turns it into an HTML
table for example and if you decide to take this route and would like the file
let me know.