title: Can't read xml data into a web page
body: <p>I need to read an xml doc into a web page. I am using ajax but am having problems reading the data. Here is my code: </p>
  
  <pre><code>function getXML() {
      var newURL = "https://www.youtube.com/api/timedtext&amp;v=5Ovh9KJ25ow&amp;lang=en";
      $(document).ready(function() {
          $.ajax({
              type: "GET",
              url: newURL,
              dataType: "xml",
              success: xmlParser
          });
      });
  
      function xmlParser(xml) {
          $(xml).find("text").each(function() {
              alert('hi');
              $("#caption").append('&lt;div&gt;' + $(this).find("text").text() + '&lt;/div&gt;');
          });
      }
  }
  </code></pre>
  
  <p>In the body of the webpage I have <code>&lt;div id="caption"&gt;&lt;/div&gt;</code>.
  If you view that URL <a href="https://www.youtube.com/api/timedtext?&amp;v=5Ovh9KJ25ow&amp;lang=en" rel="nofollow noreferrer">https://www.youtube.com/api/timedtext?&amp;v=5Ovh9KJ25ow&amp;lang=en</a> you will see that it is an xml doc with "text" nodes. These nodes also include a "start" attribute that I will need as well. I put a javascript alert('hi') in just to see if it was running and I get "hi" 19 times as expected for the 19 text nodes, but nothing gets written to my div. Once I get the data to show up, how do I access the "start" attribute data? </p>