title: js parsing XML from JSP, storing values
body: <p>I'm parsing XML and would like to store the values in an easy-to-read fashion.</p>
  
  <p>I am getting mapShapes and mapPoints (so x and y coordinates).  An (x,y) pair makes a point, a collection of points makes a Shape.</p>
  
  <p>Here is some example XML that I would like to parse:</p>
  
  <pre><code>&lt;?xml version='1.0'?&gt;
  &lt;mapQuery id='10918014'&gt;
      &lt;mapShape id='429436'&gt;
          &lt;mapPoint id='4259799'&gt;
              &lt;x&gt;-81.61508&lt;/x&gt;
              &lt;y&gt;41.52184&lt;/y&gt;
          &lt;/mapPoint&gt;
          &lt;mapPoint id='4259800'&gt;
              &lt;x&gt;-81.61537&lt;/x&gt;
              &lt;y&gt;41.52181&lt;/y&gt;
          &lt;/mapPoint&gt;
          &lt;mapPoint id='4259801'&gt;
              &lt;x&gt;-81.61538&lt;/x&gt;
              &lt;y&gt;41.522198&lt;/y&gt;
          &lt;/mapPoint&gt;
          &lt;mapPoint id='4259802'&gt;
              &lt;x&gt;-81.61516&lt;/x&gt;
              &lt;y&gt;41.52222&lt;/y&gt;
          &lt;/mapPoint&gt;
          &lt;mapPoint id='4259803'&gt;
              &lt;x&gt;-81.61508&lt;/x&gt;
              &lt;y&gt;41.52184&lt;/y&gt;
          &lt;/mapPoint&gt;
      &lt;/mapShape&gt;
  &lt;/mapQuery&gt;
  </code></pre>
  
  <p>I would like to end up with an array like</p>
  
  <pre><code>shapes[0].point[0].x[0] = first x point
  shapes[0].point[0].y[0] = first y point
  </code></pre>
  
  <p>(this example XML only has one shape present, but there could be several.)</p>
  
  <p>Thanks in advance for the help with an easy question =)</p>
  
  <p>Here's some skeleton code:</p>
  
  <pre><code>shapeXmlHandler : function(xml){
  
      $(xml).find("mapShape").each(function(){
          $(this).find("mapPoint").each(function() {
              console.log('mapPoint: '+$(this).attr('id'));
              console.log('x :'+$(this).find("x").text());
              console.log('y :'+$(this).find("y").text());
          });
      });
  }
  </code></pre>