How are you currently creating the XML from your query results?

There would be many ways to approach this, without knowing what you are currently doing, I'm not sure if I have any new thoughts for...