I have a problem with internet explorer.when i request data from a xmlhttprequest ie return nothing and the others browser works correctly.

the code is:
Code:
var receiveReq = getXMLHttpRequest();
var xmldoc;
	
	function getXMLHttpRequest() {
		var
		 XHR = null,
		 browserUtente = navigator.userAgent.toUpperCase();
		 if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object")
		  XHR = new XMLHttpRequest();
		 // browser Internet Explorer
		 // è necessario filtrare la versione 4
		 else if(
		  window.ActiveXObject &&
		  browserUtente.indexOf("MSIE 4") < 0
		 ) {
		  // la versione 6 di IE ha un nome differente
		  // per il tipo di oggetto ActiveX
		  if(browserUtente.indexOf("MSIE 5") < 0)
		   XHR = new ActiveXObject("Msxml2.XMLHTTP");
		  // le versioni 5 e 5.5 invece sfruttano lo stesso nome
		  else
		   XHR = new ActiveXObject("Microsoft.XMLHTTP");
		 }

		 return XHR;
	}

....
if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
     receiveReq.open('GET', "xmlGet.php?chat=1",true);
     receiveReq.onreadystatechange = function(){
     if (receiveReq.readyState == 4) {
	xmldoc = receiveReq.responseXML;
	if(serviceChat)chatReceive();
    }
    receiveReq.send(null);
   }			
}

...
function chatReceive(){
   var chat_div = document.getElementById('div_chat');
   var online_div = document.getElementById('utenti_online');	
   var message_nodes = xmldoc.getElementsByTagName('message'); 
   var n_messages = message_nodes.length;
...

The problem is that in ie n_messages is always equals to 0 and the others browser no
Why?
Thsnk