<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>Latest snippets tagged tidy</title>
  <link rel="alternate" href="http://snippets.prendreuncafe.com/snippets/tagged/tidy/order_by/date"></link>
  <id>http://snippets.prendreuncafe.com/snippets/tagged/tidy/order_by/date</id>
  <updated>2007-04-16T22:23:23Z</updated>
  <author>
    <name>Symfony</name>
    <author_email>noreply@symfony-project.com</author_email>
  </author>
<entry>
  <title>Formatter un document XML avec DOM et PHP5</title>
  <link href="http://snippets.prendreuncafe.com/snippet/66"></link>
  <updated>2007-04-16T22:23:23Z</updated>
  <id>66</id>
  <summary type="html">Ça peut bien aider.

[code php]
$dom = new DOMDocument('1.0', 'UTF-8');
$dom-&gt;preserveWhiteSpace = false;
$dom-&gt;load('/path/to/file.xml');
$dom-&gt;formatOutput = true;
file_put_contents('formatted.xml', $dom-&gt;saveXML());
[/code]</summary>
</entry>
</feed>