﻿/*
gnn=getNodeByName
cc=childsCount
cns=childNodes
*/
try{
_element.prototype.getValue=function(){
	if(!arguments){
		if(this.contents[0])return this.contents[0].value;
		else return "";
	}
	for(var i=0;i<this.contents.length;i++){
		if(this.contents[i].name==arguments[0]){
			if(this.contents[i].contents[0])return this.contents[i].contents[0].value;
			return "";
		}
	}
}
}catch(e){}


var X2Doc=Class.create();
X2Doc.prototype={
	initialize:function(str){
		this.root=Xparse(str);
		this.root=this.root.contents[0];
		this.rootName=this.root.name;
		this.cns=this.root.contents;
		this.cc=this.cns.length;
	},
	gnn:function(node,name){
		for(var i=0;i<node.contents.length;i++){
			if(node.contents[i].name==name)return node.contents[i];
		}
		return null;
	}
}
