function Xml()
{
   this.isIE=(navigator.userAgent.indexOf('MSIE') >= 0) ? 1 : 0; 
   this.isFirefox=(navigator.userAgent.indexOf('Firefox') >= 0) ? 1 : 0;
   
   this.ParseFromString=function(i_sString)
   {  
      var oXmlDoc=null;
      
      if(this.isIE)
      {
      	var oXml=new ActiveXObject("Microsoft.XMLDOM");
		oXml.async=false;
				   
		oXml.loadXML(i_sString);
		oXmlDoc=oXml;
      }
      else if(this.isFirefox)
      {
        
      	oXmlDoc=new DOMParser();
		oXmlDoc=oXmlDoc.parseFromString(i_sString,"text/xml");
      } 
      
      return oXmlDoc;
   }
  
   this.GetXslt=function(i_sPath)
   {
      var oXslt=null;
      
	  if(this.isIE)
	  {
	    oXslt=new ActiveXObject("Microsoft.XMLDOM");
        oXslt.async=false;
	    oXslt.load(i_sPath);
	  }
	  else if(this.isFirefox)
	  {
	  	 var oXsltProcessor=new XSLTProcessor();
		 var oXsl=new XMLHttpRequest();
	     oXsl.open("GET",i_sPath,false);
		 oXsl.send(null);
         oXsltProcessor.importStylesheet(oXsl.responseXML);
         oXslt=oXsltProcessor;
         
	  }
	  
	  return oXslt;
   }
   
   this.TransformIntoHtmlElement=function(i_sXml,i_sXsltPath,ElementID)
   {
      var oResult=null;
      
      if(this.isIE)
      {  
         var oXmlDoc=i_sXml;
         var oXslt=this.GetXslt(i_sXsltPath);
         
         oResult=oXmlDoc.transformNode(oXslt)
         
         if(document.getElementById(ElementID))
         {
            document.getElementById(ElementID).innerHTML=oResult;
         }
      }
      else if(this.isFirefox)
      {
         var oXmlDoc=i_sXml;
         var oXslt=this.GetXslt(i_sXsltPath);
         
         var oResult=oXslt.transformToFragment(oXmlDoc,document);
         
         if(document.getElementById(ElementID))
         {
            document.getElementById(ElementID).removeChild(document.getElementById(ElementID).firstChild)
	        document.getElementById(ElementID).appendChild(oResult);
         }
   
      }
      
      
      return oResult;
   }
   
   this.GetText=function(oNode)
   {
      var sText="";
      
      for(var i=0;i<oNode.childNodes.length;i++)
      {
          if(oNode.childNodes[i].hasChildNodes())
          {
             sText+=this.GetText(oNode.childNodes[i]);
          }
          else
          {
            sText+=oNode.childNodes[i].nodeValue;
          }
      }
      
      return sText;
   }
  
   
}





