function XMLObject(xmlresp){
	
	
	
	this.clean = function(d){
		var bal=d.getElementsByTagName('*');
		
		for(i=0;i<bal.length;i++){
			a=bal[i].previousSibling;
			if(a && a.nodeType==3){this.go(a)};
			b=bal[i].nextSibling;
			if(b && b.nodeType==3){this.go(b)};
		}
		
		return d;
	} 
	
	this.go = function(c){
		
		if(!c.data.replace(/\s/g,''))
			c.parentNode.removeChild(c);
		
	}
	
	
		
	this.getValue = function(what){
		
		//Debug.writeTree(this.xmlr);//sgetElementsByTagName(what).length);
		if(this.xmlr.nodeName == what)
			return this.xmlr.firstChild.nodeValue;
		else if(this.xmlr.getElementsByTagName(what).length == 1)
			return this.xmlr.getElementsByTagName(what)[0].firstChild.nodeValue;//.firstChild.nodeValue;
		else
			return null;
	}
	
	this.getValueObj = function(what){
		if(this.xmlr.nodeName == what)
			return this.xmlr.childNodes;
		if(this.xmlr.getElementsByTagName(what).length == 1)
			return this.xmlr.getElementsByTagName(what)[0].childNodes;//.firstChild.nodeValue;
		else
			return null;
	}
	
	this.xmlr = this.clean(xmlresp);
	
	if(this.getValue('parsererror') != null){
		Debug.write("Parser Error :");
		Debug.write(this.getValue('parsererror'));
		Debug.write(this.getValue('sourcetext'));
		Debug.newLine();
		return;
	}
	
}