title: How to parse multiple XML data using Jquery?
body: <p>I'm getting response in XML using Ajax call, i can parse the data but only a single data not multiple data elements, what i am getting in xml response is:</p>
  
  <pre><code>           &lt;GetTimeSlotsForUserType_1Response&gt;
               &lt;GetTimeSlotsForUserType_1Result&gt;
                &lt;NewDataSet xmlns=""&gt;
                &lt;Table diffgr:id="Table1" msdata:rowOrder="0"&gt;
                   &lt;SlotId&gt;406&lt;/SlotId&gt;
                   &lt;TimeAvailable&gt; 01:00&lt;/TimeAvailable&gt;
                   &lt;CutOffHours&gt;0.50&lt;/CutOffHours&gt;
                   &lt;Sequence&gt;1&lt;/Sequence&gt;
                &lt;/Table&gt;
                &lt;Table diffgr:id="Table2" msdata:rowOrder="1"&gt;
                   &lt;SlotId&gt;408&lt;/SlotId&gt;
                   &lt;TimeAvailable&gt;02:00&lt;/TimeAvailable&gt;
                   &lt;CutOffHours&gt;0.50&lt;/CutOffHours&gt;
                   &lt;Sequence&gt;1&lt;/Sequence&gt;
                &lt;/Table&gt;
                &lt;Table diffgr:id="Table3" msdata:rowOrder="2"&gt;
                   &lt;SlotId&gt;410&lt;/SlotId&gt;
                   &lt;TimeAvailable&gt;03:00&lt;/TimeAvailable&gt;
                   &lt;CutOffHours&gt;0.50&lt;/CutOffHours&gt;
                   &lt;Sequence&gt;1&lt;/Sequence&gt;
                &lt;/Table&gt;
                &lt;Table diffgr:id="Table4" msdata:rowOrder="3"&gt;
                   &lt;SlotId&gt;412&lt;/SlotId&gt;
                   &lt;TimeAvailable&gt;04:00&lt;/TimeAvailable&gt;
                   &lt;CutOffHours&gt;0.50&lt;/CutOffHours&gt;
                   &lt;Sequence&gt;1&lt;/Sequence&gt;
                &lt;/Table&gt;
                &lt;Table diffgr:id="Table5" msdata:rowOrder="4"&gt;
                   &lt;SlotId&gt;414&lt;/SlotId&gt;
                   &lt;TimeAvailable&gt;05:00&lt;/TimeAvailable&gt;
                   &lt;CutOffHours&gt;0.50&lt;/CutOffHours&gt;
                   &lt;Sequence&gt;1&lt;/Sequence&gt;
                &lt;/Table&gt;
             &lt;/NewDataSet&gt;
       &lt;/GetTimeSlotsForUserType_1Result&gt;
    &lt;/GetTimeSlotsForUserType_1Response&gt;
  </code></pre>
  
  <p>I need the various  elements and put them one by one in the Select menu in my HTML page. </p>
  
  <p>Jquery code:</p>
  
  <pre><code>function GetTimeSlotsForUser(){
  var soapMessage4='&lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;soap:Body&gt;&lt;GetTimeSlotsForUserType_1 xmlns="http://there.org/"&gt;&lt;opFacId&gt;'+ OpFacId +'&lt;/opFacId&gt;&lt;requestType&gt;'+ check +'&lt;/requestType&gt;&lt;category&gt;'+ category +'&lt;/category&gt;&lt;availableFor&gt;'+ issignee +'&lt;/availableFor&gt;&lt;/GetTimeSlotsForUserType_1&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;';
  
   $.ajax({
      url: "http://33.204.22.31/therewebservice/therewebservice.asmx?op=GetTimeSlotsForUserType_1",
      type: "POST",
      dataType: "xml",
      SOAPAction: "http://there.org/GetTimeSlotsForUserType_1",
      data: soapMessage4,
      complete: endSaveProduct4,
      contentType: "text/xml; charset=\"utf-8\""
         });
  
  return false;
  }
  
  function endSaveProduct4(xmlHttpRequest,status){
  var optionlist='&lt;option value="select-value-2"&gt;-- Select Time --&lt;/option&gt;';
  
  $(xmlHttpRequest.responseXML)
  .find('NewDataSet')
  .each(function()
        {
        var timeAvailable=$(this).find('TimeAvailable').text();
        optionlist += '&lt;option&gt;' + timeAvailable + '&lt;/option&gt;';
  
        });
  $("#select-choice-2").html(optionlist).selectmenu('refresh', true);
  }
  </code></pre>
  
  <p>Till here i am able to get the data in optionlist, but it just grab all the  elements and put it as a one option in my select menu like this...:</p>
  
  <p><img src="https://i.stack.imgur.com/TLVZz.png" alt="You can see the data is coming in one single option, instead of different options"></p>
  
  <p>What i want is to parse all the different "Time Available" elements from the xml and to display it as multiple options in select menu.
  Please help.</p>