title: Is this the fastest way to parse my XML into JavaScript objects using jQuery?
body: <p>I have an XML file like this:</p>
  
  <pre><code>&lt;content&gt;
      &lt;box&gt;
          &lt;var1&gt;A1&lt;/var1&gt;
          &lt;var2&gt;B1&lt;/var2&gt;
          &lt;var3&gt;C1&lt;/var3&gt;
          &lt;var4&gt;D1&lt;/var4&gt;
      &lt;/box&gt;
      &lt;box&gt;
          &lt;var1&gt;A2&lt;/var1&gt;
          &lt;var2&gt;B2&lt;/var2&gt;
          &lt;var3&gt;C2&lt;/var3&gt;
          &lt;var4&gt;D2&lt;/var4&gt;
      &lt;/box&gt;
      &lt;box&gt;
          &lt;var1&gt;A3&lt;/var1&gt;
          &lt;var2&gt;B3&lt;/var2&gt;
          &lt;var3&gt;C3&lt;/var3&gt;
          &lt;var4&gt;D3&lt;/var4&gt;
      &lt;/box&gt;
  &lt;/content&gt;
  </code></pre>
  
  <p>It has 500 <code>box</code> elements which I need to parse into JavaScript objects. I am using this code which works fine but I am a newbie and maybe I am missing something and would like to get suggestions if there is a better/faster way to do it:</p>
  
  <pre><code>var app = {
      //...
      box: [],
  
      init: function (file) {
          var that = this;
  
          $.ajax({
              type: "GET",
              url: file,
              dataType: "xml",
              success: function (xml) {
                  $("box", xml).each(function (i) {
                      var e = $(this);
                      that.box[i] = new Box(i, {
                          var1: e.children("var1").text(),
                          var2: e.children("var2").text(),
                          var3: e.children("var3").text(),
                          var4: e.children("var4").text()
                      });
                  });
              }
          });
      },
      //...
  };
  </code></pre>
  
  <p>Thanks in advance.</p>