title: Group javascript xml output by letters or other attributes
body: <p>I have an xml document that looks something like this </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;mapPoints&gt;
  &lt;annotation cat="A" title="123" type="pointer"/&gt;
  &lt;annotation cat="A" title="333" type="pointer"/&gt;
  &lt;annotation cat="B" title="555" type="pointer"/&gt;
  &lt;/mapPoints&gt;
  </code></pre>
  
  <p>I am parsing the XML into my javascript document. 
  Now, I want to group the output of my xml file in different divs base on the cat in the xml so that the markup would look something like this</p>
  
  <pre><code>&lt;div class="A"&gt;
  &lt;ul&gt;
  &lt;li&gt;123 cat A&lt;/li&gt;
  &lt;li&gt;333 cat A&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  &lt;div class="B"&gt;
  &lt;ul&gt;
  &lt;li&gt;555 cat B&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My parsing is working properly but I don't know how I would group the entries and then output them into different divs. The solution needs to be dynamic since it could be a lot of categories.</p>