title: How to do loop using Jquery .load from an external xml file
body: <p>I'm trying to access an external xml stored in the same domain and using jquery .load, I want to do a loop within the the rest of the nodes.</p>
  
  <p>Issue: I can only retrieve 1 node using .load. </p>
  
  <p>Here's my external xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt; 
  &lt;Main_List&gt;
  &lt;links&gt;
        &lt;header&gt;Header 1&lt;/header&gt; 
      - &lt;link_items&gt;
        &lt;url_label&gt;URL Label 1&lt;/url_label&gt; 
        &lt;url&gt;http://stackoverflow.com&lt;/url&gt; 
        &lt;url_target&gt;_self&lt;/url_target&gt; 
        &lt;/link_items&gt;
        &lt;link_items&gt;
        &lt;url_label&gt;URL Label 2&lt;/url_label&gt; 
        &lt;url&gt;http://stackoverflow2.com&lt;/url&gt; 
        &lt;url_target&gt;_self&lt;/url_target&gt; 
        &lt;/link_items&gt;
        &lt;link_items&gt;
        &lt;url_label&gt;URL Label 3&lt;/url_label&gt; 
        &lt;url&gt;http://stackoverflow3.com&lt;/url&gt; 
        &lt;url_target&gt;_self&lt;/url_target&gt; 
        &lt;/link_items&gt;
        &lt;link_items&gt;
        &lt;url_label&gt;URL Label 4&lt;/url_label&gt; 
        &lt;url&gt;http://stackoverflow4.com&lt;/url&gt; 
        &lt;url_target&gt;_self&lt;/url_target&gt; 
        &lt;/link_items&gt;
    &lt;/links&gt;
    &lt;/Main_List&gt;
  </code></pre>
  
  <p>Here's my script</p>
  
  <pre><code>$( "#header" ).load("main_list.xml header"); 
      $( "#url_label" ).load("main_list.xml url_label");
  
      // load url to temp div, then set as variable and to change attributes
      $('#temp').load("main_list.xml url", function(url) {
      var getNode_url = $('#temp').text();
      jQuery('#url_label').attr('href',getNode_url);
      });
  </code></pre>
  
  <p>Here's my target div</p>
  
  <pre><code>&lt;div id="header"&gt;&lt;/div&gt;
  &lt;a id="url_label&gt;&lt;/a&gt;&lt;br&gt;
  &lt;div id="temp" style="display:none"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>My expected result should be</p>
  
  <pre><code>Header 1
  &lt;a href="http://stackoverflow.com" target="_self"&gt;URL Label 1&lt;/a&gt;
  &lt;a href="http://stackoverflow2.com" target="_self"&gt;URL Label 2&lt;/a&gt;
  &lt;a href="http://stackoverflow3.com" target="_self"&gt;URL Label 3&lt;/a&gt;
  &lt;a href="http://stackoverflow4.com" target="_self"&gt;URL Label 4&lt;/a&gt;
  </code></pre>