<p>This code is from <em>Prototype.js</em>. I've looked at probably 20 different tutorials, and I can't figure out why this is not working. The response I get is null.</p>

<pre><code>new Ajax.Request(/path/to / xml / file.xml, {
   method: "get",
   contentType: "application/xml",
   onSuccess: function(transport) {
      alert(transport.responseXML);
   }
});
</code></pre>

<p>If I change the <code>responseXML</code> to <code>responseText</code>, then it alerts to me the XML file as a string. This is not a PHP page serving up XML, but an actual XML file, so I know it is not the response headers.</p>

[{'answer_id': 54637, 'author': '17 of 26', 'author_id': 2284, 'author_profile': 'https://Stackoverflow.com/users/2284', 'pm_score': 3, 'selected': True, 'text': "<p>If transport.responseXML is null but you have a value for transport.responseText then I believe it's because it's not a valid XML file.</p>\n\n<p><strong>Edit:</strong>  I just noticed that in our code here whenever we request an XML file we set the content type to 'text/xml'.  I have no idea if that makes a difference or not.</p>\n"}, {'answer_id': 12488558, 'author': 'riverX', 'author_id': 1682030, 'author_profile': 'https://Stackoverflow.com/users/1682030', 'pm_score': 1, 'selected': False, 'text': '<p>Just want to share my afternoon working on the issue with a NULL result for <strong>responseXML</strong> responses. My results were exactly as described in the question: responseText was filled with the XML file, responseXML was NULL. As i was totally sure my file is in valid XML format, the error must be somewhere different.</p>\n\n<p>As mentioned in the <strong>Prototype v1.7</strong> documentation, i set the content type to <strong>"application/xml"</strong>. The response sent was constantly "text/html", no matter what. </p>\n\n<p>To make it short, the problem i ran into was, that my XML file had the ending <strong>".gpx"</strong> as it\'s a de facto standard for GPS coordinates. The mime-types collection of my local XAMPP Apache installation only foresees the endings "xml" and "xsl". After adding "gpx" and restarting the server the program ran smoothly as it\'s supposed to be.</p>\n\n<p>In my case, there are three solutions:</p>\n\n<p>1) edit the "mime.types" file of Apache. Using an XAMPP installation, you might find it under "C:\\xampp\\apache\\conf\\mime.types". Search for the "application/xml" record and change as follows:</p>\n\n<pre><code>application/xml xml xsl gpx\n</code></pre>\n\n<p>Don\'t forget to restart the server!</p>\n\n<p>2) add the mime type in a <strong>.htaccess</strong> of the appropriate folder. Open or create a .htaccess file and add following line:</p>\n\n<pre><code>AddType application/xml xml xsl gpx\n</code></pre>\n\n<p>3) during upload process, change file type to "xml" instead of whatever you have</p>\n\n<p>Hope i safe some time to one of you guys.</p>\n'}]
['https://Stackoverflow.com/questions/54626', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']