title: Symfony Controller - How to return XML response?
body: <p>I want to return in my <code>RandomController::indexAction()</code> an XML Response:</p>
  
  <pre><code>return new Response($this-&gt;renderView(
      'AcmeRandomBundle:Random:index.xml.twig',
      array(
          'randomParameter' =&gt; $randomParameter
      )
  ));
  </code></pre>
  
  <p>where <code>index.xml.twig</code> is like that:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;randomTag&gt;
      {{ randomParameter }}
  &lt;/randomTag&gt;
  </code></pre>
  
  <p>When I want to open this action in firefox, I get in firebug:</p>
  
  <pre><code>&lt;html&gt;
     &lt;body&gt;
      &lt;randomTag&gt;
          randomValue
      &lt;/randomTag&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How to return correct XML response?</p>