Back in the day I did my share of XML-processing and if I learned anything then that all modules suck at outputting XML. Either you run into encoding issues, or something chokes on namespaces or whatnot.
Instead I looked at the problem a different way: I have data in memory. I want a textual representation of it. I use templates. That also decouples output from code which can be a good thing. You have one more file to handle though.
holli
You can lead your users to water, but alas, you cannot drown them.