title: Laravel how to output db records as XML?
body: <p>I cant deal with such simple (I think) thing like output records from database as XML. I have eloquent model named Customer and I want to send to output all customers from db so I've tried to install response macro ( <a href="http://www.laravel-tricks.com/tricks/responsexml-macro" rel="nofollow">http://www.laravel-tricks.com/tricks/responsexml-macro</a> ) and I call it like this:</p>
  
  <pre><code>public function showCustomers()
  {
     $customers = Customer::all()-&gt;toArray();
     return Response::xml($customers);
  }
  </code></pre>
  
  <p>but then I got error "SimpleXMLElement::addChild(): unterminated entity reference M" . I tried also other solution which used SimpleXMLELement also so the result was the same. </p>