title: save XML file in minified form using DOMDocument
body: <p>I want to save space by saving the xml file in minified  form </p>
  
  <p>for example </p>
  
  <pre><code>&lt;body&gt;
    &lt;div&gt;
      &lt;p&gt;hello&lt;/p&gt;
      &lt;div/&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>it should be saved like this </p>
  
  <pre><code>&lt;body&gt;&lt;div&gt;&lt;p&gt;hello&lt;/p&gt;&lt;div/&gt;&lt;/div&gt;&lt;/body&gt;
  </code></pre>
  
  <p>I'm using  DOMDocument to create xml file like this </p>
  
  <pre><code>$xml = new DOMDocument("1.0", "UTF-8");
          $xml-&gt;preserveWhiteSpace = false;
          $xml-&gt;formatOutput = false;
  
          $feed = $xml-&gt;createElement("feed");
          $feed = $xml-&gt;appendChild($feed);
  /*add attribute*/
          $feed_attribute        = $xml-&gt;createAttribute('xmlns:xsi');
          $feed_attribute-&gt;value = 'http://www.w3.org/2001/XMLSchema-instance';
          $feed-&gt;appendChild($feed_attribute);
          $aggregator = $xml-&gt;createElement("aggregator");
          $aggregator = $feed-&gt;appendChild($aggregator);
          $name       = $xml-&gt;createElement('name', 'test.com');
          $aggregator-&gt;appendChild($name);
  ...etc
          $xml-&gt;save(public_path() .$string, LIBXML_NOEMPTYTAG);
  </code></pre>