function XMLParser(xml_code_or_file){
	
	var xml;
	
	this.XMLParser = function(xml_code_or_file){
		if(xml_code_or_file.match(/^[\w- ]+\..*$/)){
			this.parseXMLFile(xml_code_or_file);
		} else {
			this.parseXMLCode(xml_code_or_file);
		}
	}
	
	this.parseXMLCode = function(xml_code){
		try { //Internet Explorer
			this.xml = new ActiveXObject("Microsoft.XMLDOM");
			this.xml.async = "false";
			this.xml.loadXML(xml_code);
		} catch(e){
			try { //Firefox, Mozilla, Opera, etc.
				parser = new DOMParser();
				this.xml = parser.parseFromString(xml_code, "text/xml");
			} catch(e){
				alert("XMLParser (code): " + e.message);
				return;
			}
		}
	}
	
	this.parseXMLFile = function(xml_file){
		try { //Internet Explorer
			this.xml = new ActiveXObject("Microsoft.XMLDOM");
		} catch(e){
			try { //Firefox, Mozilla, Opera, etc.
				this.xml = document.implementation.createDocument("", "", null);
			} catch(e){
				alert("XMLParser (file): " + e.message);
				return;
			}
		}
		this.xml.async = false;
		this.xml.load(xml_file);	
	}
	
	this.getTag = function(tag_name){
		return this.xml.getElementsByTagName(tag_name)[0].childNodes[0].nodeValue;
	}
	
	this.getElementsByTagName = function(tag_name){
		return this.xml.getElementsByTagName(tag_name);
	}
	
	this.XMLParser(xml_code_or_file);
}