
function XmlObject(xml){

        try {//Internet Explorer
                this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
                this.xmlDoc.async="false";
                this.xmlDoc.loadXML(xml);
                this.status = 1;
        }catch(e) {
                try { //Firefox, Mozilla, Opera, etc.
                        var parser=new DOMParser();
                        this.xmlDoc=parser.parseFromString(xml,"text/xml");
                        this.status = 1;
          }catch(e) {
                this.status = 0;
                alert(e.message);
          }
        }

        this.is = function(name){
                if(this.getNode(name)!=null)
                        return true;
                return false;
        }

        this.getNodes = function(name){
                var nodes = this.xmlDoc.getElementsByTagName(name);
                var result = new Array();
                var i;
                if(nodes!=null)
	                for(i=0;i<nodes.length;i++)
	                        try{
	                                if(nodes[i].nodeName==name){
	                                        result[result.length] = nodes[i];
	                                }
	                        }catch(e){}
                return result;
        }

        this.getNode = function(name){
                var nodes = this.getNodes(name);
                if(nodes.length>0)
                        return nodes[0];
                return null;
        }

        this.getValue = function(){
                return this.childNodes[0].value;
        }

}

