@Override
	public String toString() {
		String result = "\n\t\t<s id=\"" + id + "\">";
		result += "\n\t\t\t<graph root=\"" + rootIDref + "\">";
		result += "\n\t\t\t\t<terminals>";
		terminals = Helper.sortByKey(terminals);
		for (Node terminal : terminals.values()) {
			result += terminal;
		}
		result += "\n\t\t\t\t</terminals>";
		result += "\n\t\t\t\t<nonterminals>";
		nonterminals = Helper.sortByKey(nonterminals);
		for (Node nonTerminal : nonterminals.values()) {
			result += nonTerminal;
		}
		result += "\n\t\t\t\t</nonterminals>";
		result += "\n\t\t\t</graph>";
		result += "\n\t\t\t<matches>\n\t\t\t</matches>";
		result += "\n\t\t\t<sem>";
		result += "\n\t\t\t\t<globals>\n\t\t\t\t</globals>";
		result += "\n\t\t\t\t<frames>";
		for (Frame frame : frames) {
			result += frame;
		}
		result += "\n\t\t\t\t</frames>";
		result += "\n\t\t\t\t<usp>";
		result += "\n\t\t\t\t\t<uspframes/>";
		result += "\n\t\t\t\t\t<uspfes/>";
		result += "\n\t\t\t\t</usp>";
		result += "\n\t\t\t\t<wordtags>";
		result += "\n\t\t\t\t</wordtags>";
		result += "\n\t\t\t</sem>";
		result += "\n\t\t</s>";
		return result;
		//return "Sentence [id=" + id + ",\n\t terminals=" + terminals
		//		+ ",\n\t nonterminals=" + nonterminals + ",\n\t frames=" + frames + "]";
	}