title: PHP and MySql to generate KML
body: <p>I'm trying to make a dynamic KML from a PHP using this <a href="https://developers.google.com/kml/articles/phpmysqlkml" rel="nofollow">Article</a>, but I already have the values of my Polygons and some of them are Multiple Polygons. I decided to put this values on a Database so I just have to query them and put it on the kml, but when a try to use it it returns this:</p>
  
  <pre><code>&amp;lt;Polygon&amp;gt;&amp;lt;extrude&amp;gt;1&amp;lt;/extrude&amp;gt;     &amp;lt;tessellate&amp;gt;1&amp;lt;/tessellate&amp;gt;&amp;lt;outerBoundaryIs&amp;gt;&amp;lt;LinearRing&amp;gt;
  &amp;lt;coordinates&amp;gt;
  </code></pre>
  
  <p>Instead of:</p>
  
  <pre><code>&lt;Polygon&gt;
  &lt;extrude&gt;1&lt;extrude&gt;
  &lt;tessallete&gt;.... etc
  </code></pre>
  
  <p>Here's how I'm trying to put this info:</p>
  
  <pre><code>$multiGeometryNode = $dom-&gt;createElement('MultiGeometry', htmlspecialchars($row['kml']));
  </code></pre>
  
  <p>Any ideas? By the way, if I use a echo to show htmlspecialchars($row['kml']) it works, but when I try to use it in the createElement it doesn't.</p>