title: XML into HTML table for a leaflet map marker popup
body: <p>I have a web map with a series of locations (Local Government Area centroids) which are filtered out my map depending on if the LGA has a feature inside or not. It achieves this via an xml document that stores the features that relate to these locations.</p>
  
  <pre><code>&lt;LGA name="ThisLGA"&gt;
        &lt;feature&gt;
             &lt;name&gt;Feature 1&lt;/name&gt;
             &lt;status&gt;lolcat&lt;/status&gt;
        &lt;/feature&gt;
        &lt;feature&gt;
             &lt;name&gt;Feature 2&lt;/name&gt;
             &lt;status&gt;lolcat&lt;/status&gt;
        &lt;/feature&gt;
  &lt;/LGA&gt;
  &lt;LGA name="ThisOtherLGA"&gt;
        &lt;feature&gt;
             &lt;name&gt;Feature 1&lt;/name&gt;
             &lt;status&gt;lolcat&lt;/status&gt;
        &lt;/feature&gt;
        &lt;feature&gt;
             &lt;name&gt;Feature 1&lt;/name&gt;
             &lt;status&gt;lolcat&lt;/status&gt;
        &lt;/feature&gt;
  &lt;/LGA&gt;
  </code></pre>
  
  <p>What I am trying to do now is have the popup for each LGA marker contain a table with each feature name and status (and possibly other attributes eventually).</p>
  
  <p>Does anyone have any suggestions on how to achieve this, I saw some people using underscore.js and creating HTML templates. However I do not know how many rows I will need so it has to be done dynamically. </p>
  
  <p>Is it something to be done with php more so than javascript?</p>