title: Cakephp Generating XML view files
body: <p>I'm trying to achieve <a href="http://book.cakephp.org/2.0/en/views/json-and-xml-views.html#using-a-data-view-with-view-files" rel="nofollow">Using a data view with view files</a>.</p>
  
  <p>But to no luck, i'm getting below error and couldn't generate the xml.</p>
  
  <pre><code>&lt;response&gt;
  &lt;code&gt;500&lt;/code&gt;
  &lt;url&gt;/photo/sitemaps/view.xml&lt;/url&gt;
  &lt;name&gt;Call to undefined method Xml::options()&lt;/name&gt;
  &lt;/response&gt;
  </code></pre>
  
  <p>To access the xml, the link is similar to this: <a href="http://www.example.com/action/view.xml" rel="nofollow">http://www.example.com/action/view.xml</a></p>
  
  <p>My View code is: </p>
  
  <pre><code>// View code - app/View/Action/xml/view.ctp
  $xmlObject = Xml::fromArray($xmlArray);
  $xmlString = $xmlObject-&gt;asXML();
  </code></pre>
  
  <p>Though I'm not sure what should my controller looks like.</p>
  
  <p>I've already enabled Router::parseExtensions().
  I've also added the RequestHandlerComponent to controller’s list of components.
  If my data is serialized in the controller, it's working perfectly.
  Btw, I'm using Cakephp 2.3.4</p>
  
  <p>Thanks in advance!</p>