title: Using SimpleXmlElement and symfony2 to output xml file
body: <pre><code>$rootNode = new \SimpleXMLElement( "&lt;?xml version='1.0' encoding='UTF-8' standalone='yes'?&gt;&lt;items&gt;&lt;/items&gt;" );
  
  $itemNode = $rootNode-&gt;addChild('item');
  $itemNode-&gt;addChild( 'itemCode', 'mk' );
  $itemNode-&gt;addChild( 'itemName', 'orange' );
  
  $itemNode = $rootNode-&gt;addChild('item');
  $itemNode-&gt;addChild( 'itemCode', 'ap' );
  $itemNode-&gt;addChild( 'itemName', 'apple' );
  
  $itemNode = $rootNode-&gt;addChild('item');
  $itemNode-&gt;addChild( 'itemCode', 'tof' );
  $itemNode-&gt;addChild( 'itemName', '豆腐' );
  
  
  $itemNode-&gt;addAttribute('stock', 'none');
  </code></pre>
  
  <p>I made xml data with SimpleXMLElement.</p>
  
  <p>then I want to output this on symfony2</p>
  
  <pre><code>return $rootNode-&gt;asXML();
  
  return $this-&gt;render($rootNode-&gt;asXML());
  </code></pre>
  
  <p>Either doesnt work. How can I output xml file?</p>