function xmlparse(xmlstring) {
	var xmldom;	

	if (document.implementation && document.implementation.createDocument)
	{
		var parser = new DOMParser();
		xmldom = parser.parseFromString(xmlstring, "text/xml");
	}
	else if (window.ActiveXObject)
	{		
		xmldom = new ActiveXObject("MSXML2.DOMDocument");
		xmldom.validateOnParse = true;
		xmldom.async = false;
		xmldom.resolveExternals = false;
		xmldom.loadXML(xmlstring);
	}
	else
	{
		throw "XML DOM is not supported by the browser.";
	}

	return xmldom;
}