	var swzXML = Class.create({
		
		initialize:function(obj){
			this.xml = obj
		},
		
		exists:function(){
			if(this.xml){
				return true;
			} else {
				return false;
			}
		},
		
		getTagLength:function(tag){
			if(this.xml.getElementsByTagName(tag)){
				return this.xml.getElementsByTagName(tag).length;
			} else {
				return -1;
			}
		},
		
		getTagValue:function(tag,index){
			if(this.xml.documentElement.getElementsByTagName(tag)[index].hasChildNodes){
				if(this.xml.documentElement.getElementsByTagName(tag)[index].firstChild){
					node = this.xml.documentElement.getElementsByTagName(tag)[index];
					node.normalize();
					return node.firstChild.data;					
				} else {
					return '';	
				}
			} else {
				return "";
			}
		},
		
		getTagAttribute:function(tag,attribute,index){
			//check the value exists
			if(this.xml.documentElement.getElementsByTagName(tag)[index].getAttribute(attribute)){
				return this.xml.documentElement.getElementsByTagName(tag)[index].getAttribute(attribute);
			} else {
				return "";
			}
		}
			
	});
