How to select single xml tag from multiple xml tags in AJAX
<p>This is HTML file (namestore.html):--</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;Ajax Practice&lt;/title&gt;
&lt;script type="text/javascript" src="namestore.js"&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;div  onkeyup="process()"&gt;
    Enter your name:&lt;input type="text"  id="userInput"/&gt;
    &lt;br /&gt;&lt;br /&gt;
    &lt;div id="outputMsg" /&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>This is PHP file (namestore.php):--</p>

<pre><code>&lt;?php
header('Content-Type: text/xml');
echo '&lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?&gt;';

echo '&lt;xtag&gt;';
    $x = 1;
echo '&lt;/xtag&gt;';

echo '&lt;response&gt;';
    $name = $_GET['name'];
    $nameArray = array('Raj','John','Sam','Mac');

    if(in_array($name,$nameArray))
    {
        echo 'Wasup'.' '. $name;
    }
    elseif($name=='')
    {
        echo 'Enter a name pal!';
    }
    else
    {
        echo 'Your name is not in our list.';
    }
echo '&lt;/response&gt;';

echo '&lt;ytag&gt;';
    $y = 2;
echo '&lt;/ytag&gt;';

echo '&lt;ztag&gt;';
    $z = 3;
echo '&lt;/ztag&gt;'; ?&gt;
</code></pre>

<p>This is JAVASCRIPT file (namestore.js):--</p>

<pre><code>var xmlHttp = createXmlHttpRequestObject();
function createXmlHttpRequestObject()
{
    var xmlHttp;
    if(window.ActiveXObject)
    {
        try{
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){
            xmlHttp = false;
        }
    }
    else
    {
        try{
            xmlHttp = new XMLHttpRequest()
        }catch(e){
            xmlHttp = false;
        }
    }

    if(!xmlHttp)
        alert("Object not created....");
    else
        return xmlHttp;
}

function process()
{
    if(xmlHttp.readyState==0 || xmlHttp.readyState==4)
    {
        name = encodeURIComponent(document.getElementById("userInput").value);
        xmlHttp.open("GET", "namestore.php?name=" +name, true);
        xmlHttp.onreadystatechange = handelResponse;
        xmlHttp.send(null);
    }
    else
    {
        setTimeout('process()', 1000);
    }   
}

function handelResponse()
{
    if(xmlHttp.readyState==4)
    {
        if(xmlHttp.status==200)
        {
            xmlResponse = xmlHttp.responseXML;
            xmlDocumentElement = xmlResponse.documentElement;
            document.getElementById("outputMsg").innerHTML = xmlResponse.getElementsByTagName("response")[0].childNodes[0].nodeValue;
            setTimeout('process()', 1000);
        }
        else
        {
            alert("Something is wrong!");
        }
    }
}
</code></pre>

<p>I am unable to fetch data from <code>&lt;response&gt;...&lt;/response&gt;</code> tag from namestore.php in namestore.js.
How can get data from <code>&lt;response&gt;...&lt;/response&gt;</code> tag.</p>

<p>Please help...</p>