title: Generate and download XML file with Laravel
body: <p>I'm trying to generate a XML file using Laravel. Starting from the Controller, where I generate the data that I need to use on the XML file. I generate the XML file using a blade template but I can't save the file or download it automatically</p>
  <pre><code>
  $xml_datos = [];
  $total = 0;
  
  .
  .
  .
  
  $output = View::make('site.contabilidad.adeudosXML')-&gt;with(compact('xml_datos', 'total'))-&gt;render();
  
  $xml = &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;UTF-8\&quot; ?&gt; \n &lt;Document xmlns=\&quot;urn:iso:std:iso:20022:tech:xsd:pain.008.001.02\&quot;&gt;&quot; .$output;
  
  return $xml;
  
  </code></pre>
  <p>I need the file to be downloaded, not showed. I've tried using the class Storage and Filesystem but none of them seems to work</p>