So far I've been using Template Toolkit for generating output in Daizu, but there's a problem with that approach: the templating language doesn't understand anything about the structure of the XML or HTML output it's producing. I'm not picking on TT, it's the best and probably most popular templating language for Perl. My problem with using it is that it always generates plain text. Of course you can arrange for the output to be correct XHTML or whatever, but there's very little support for doing that.