<p>Given this in a grails action:</p>

<pre><code>def xml = {
    rss(version: '2.0') {
        ...
    }
}
render(contentType: 'application/rss+xml', xml)
</code></pre>

<p>I see this:</p>

<pre><code>&lt;rss&gt;&lt;channel&gt;&lt;title&gt;&lt;/title&gt;&lt;description&gt;&lt;/description&gt;&lt;link&gt;&lt;/link&gt;&lt;item&gt;&lt;/item&gt;&lt;/channel&gt;&lt;/rss&gt;
</code></pre>

<p>Is there an easy way to pretty print the XML? Something built into the render method, perhaps?</p>

This is a simple way to pretty-print XML, using Groovy code only:
```
```
def xml = "<rss><channel><title></title><description>" +
   "</description><link></link><item></item></channel></rss>"

def stringWriter = new StringWriter()
def node = new XmlParser().parseText(xml);
new XmlNodePrinter(new PrintWriter(stringWriter)).print(node)

println stringWriter.toString()
```
```
results in:
```
```
<rss>
  <channel>
    <title/>
    <description/>
    <link/>
    <item/>
  </channel>
</rss>
```
```