title: getElementsByTagName 'undefined' in Firefox and Chrome?
body: <p>I am having a problem with getElementsByTagName. I am trying to pull information from an xml file I received from the server using ajax. In IE it is works fine, but when I try to run it on Chrome or FireFox I get an "undefined".</p>
  
  <p><strong>Javascript</strong>:</p>
  
  <pre><code>function parseMessage()
  {
      doc = request.responseXML;
      sum = "";
  
      for (var i=0; i&lt; doc.getElementsByTagName('coupon').length; i=i+1)
      {
          var lat2 = doc.documentElement.getElementsByTagName('latitude').item(i).text;
          var longi2 = doc.documentElement.getElementsByTagName('longitude').item(i).text;
          var latlng  = new google.maps.LatLng( lat2 , longi2 ); 
          var product =  doc.documentElement.getElementsByTagName('productname').item(i).text;
          // marker[i] = createMarker(map2, product, latlng, description);
  
          sum = sum + description+ " "+ product + lat2 + longi2;                          
      }
  
      document.write(sum);
  }           
  </code></pre>
  
  <p><strong>XML</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  -&lt;coupons&gt;
  -&lt;coupon id="1"&gt;
  &lt;productname&gt;Bigmac&lt;/productname&gt;
  &lt;companyname&gt;Macdonalds&lt;/companyname&gt;
  &lt;latitude&gt;32.015954&lt;/latitude&gt;
  &lt;longitude&gt;34.755228&lt;/longitude&gt;
  &lt;/coupon&gt;
  -&lt;coupon id="2"&gt;
  &lt;productname&gt;Crocs&lt;/productname&gt;
  &lt;companyname&gt;Crocs&lt;/companyname&gt;
  &lt;latitude&gt;32.079375&lt;/latitude&gt;
  &lt;longitude&gt;34.769325&lt;/longitude&gt;
  &lt;/coupon&gt;
  -&lt;coupon id="3"&gt;
  &lt;productname&gt;Nike Shoks&lt;/productname&gt;
  &lt;companyname&gt;NIKE&lt;/companyname&gt;
  &lt;latitude&gt;32.048825&lt;/latitude&gt;
  &lt;longitude&gt;34.785461&lt;/longitude&gt;
  &lt;/coupon&gt;
  -&lt;coupon id="4"&gt;
  .....
  </code></pre>