}
void	xmlparse(std::string &s,std::size_t &pos,XMLnode *x){	bool	intag=true;	while(pos<s.length())		{		switch(s[pos])			{			case '<':				{				// New tag?				if(s[pos+1]=='/')					{					// No. Close tag.					while(s[pos]!='>')						pos++;					pos++;					trim(x->entity.content);//					cout << "End of entity(1) '"<<x->entity.id <<"' ("<<x->entity.content<<")"<<endl;					return;					}				XMLnode *t = new XMLnode;				++pos;				xmlparse(s,pos,t);				x->nodelist.push_back(t);				break;				}			case '>':				// End of tag				if(s[pos-1]=='/')					{					++pos;					return; // An empty tag					}				++pos; intag=false; if(s[pos]<32) ++pos;				break;			case '&':				x->entity.content+=entity_decode(s,pos);				break;			default:				if(intag)					x->entity.id+=s[pos++];				else					{					x->entity.content+=s[pos++];					}			}		}	trim(x->entity.content);//	cout << "End of entity(2) '"<<x->entity.id <<"' ("<<x->entity.content<<")"<<endl;}