Given this in a grails action:
def xml = { rss(version: \'2.0\') { ... } } render(contentType: \'application/rss+xml\', xml)
Use XmlUtil :
def xml = "" + "" println XmlUtil.serialize(xml)