title: XML API Children Return Function?
body: <p>I'm performing an API call to a controller that returns XML. The output is:</p>
  
  <pre><code>&lt;ArrayOfreport_overallTime&gt;
      &lt;report_overallTime&gt;
          &lt;label&gt;United States&lt;/label&gt;
          &lt;value&gt;65&lt;/value&gt;
      &lt;/report_overallTime&gt;
      &lt;report_overallTime&gt;
          &lt;label&gt;United Kingdom&lt;/label&gt;
          &lt;value&gt;58&lt;/value&gt;
      &lt;/report_overallTime&gt;
      &lt;report_overallTime&gt;
          &lt;label&gt;Germany&lt;/label&gt;
          &lt;value&gt;30&lt;/value&gt;
      &lt;/report_overallTime&gt;
      &lt;report_overallTime&gt;
          &lt;label&gt;India&lt;/label&gt;
          &lt;value&gt;65&lt;/value&gt;
      &lt;/report_overallTime&gt;
      &lt;report_overallTime&gt;
          &lt;label&gt;Russia&lt;/label&gt;
          &lt;value&gt;65&lt;/value&gt;
      &lt;/report_overallTime&gt;
      &lt;report_overallTime&gt;
          &lt;label&gt;Germany&lt;/label&gt;
          &lt;value&gt;30&lt;/value&gt;
      &lt;/report_overallTime&gt;
  &lt;/ArrayOfreport_overallTime&gt;
  </code></pre>
  
  <p>This is generated from the following C# controller code:</p>
  
  <pre><code>public class report_overallTimeController : ApiController
  {
      public void report_overallTime(HttpContext context)
      {
          var request = HttpContext.Current.Request;
          var settings = Properties.Settings.Default;
          GetAllItems();
      }
  
      report_overallTime[] items = new report_overallTime[]
      {
          new report_overallTime { label = "United States", value = "65" },
          new report_overallTime { label = "United Kingdom", value = "58" },
          new report_overallTime { label = "Germany", value = "30" },
          new report_overallTime { label = "India", value = "65" },
          new report_overallTime { label = "Russia", value = "65" },
          new report_overallTime { label = "Germany", value = "30" }
      };
  
      public IEnumerable&lt;report_overallTime&gt; GetAllItems()
      {
          return items;
      }       
  }
  </code></pre>
  
  <p>In my jQuery, I'm attempting to get the label/value pairs and insert them into an array. </p>
  
  <pre><code>function initChart(xml) {
      var data = [];
      //alert((new XMLSerializer()).serializeToString(xml));
      $(xml).find('ArrayOfreport_overallTime report_overallTime').each(function (index) {
          var label = $(this).children("label").text;
          var value = $(this).children("value").text;
          data.push([label, parseFloat(value)]);
      });
      //Do something with data...
  }
  </code></pre>
  
  <p>When I try to output the values of var label, I get the following on my alert:</p>
  
  <pre><code>function(a) {
      return Y(this, function(a) {
          return void 0 === a ? n.text(this) : this.empty().append((this[0] &amp;&amp; this[0].ownerDocument || d).createTextNode(a))
      }, null, a, arguments.length)
  }
  </code></pre>
  
  <p>What am I doing wrong? I am expecting to be alerted with the country. </p>