@Override
	public String toString() {
		String result;
		//Terminal?
		if (isTerminal()) {
			result = "\n\t\t\t\t\t<t";
			for (Map.Entry<String, String> attribute : attributes.entrySet()) {
				result += " " + attribute.getKey() + "=\"" + StringEscapeUtils.escapeXml(attribute.getValue()) + "\"";
			}
			result += "/>";
			return result;
		} else {
			result = "\n\t\t\t\t\t<nt id=\"" + id + "\"" + " cat=\"" + StringEscapeUtils.escapeXml(category) + "\">";
			for (Map.Entry<String, String> edge : edges.entrySet()) {
				result += "\n\t\t\t\t\t\t<edge label=\"" + StringEscapeUtils.escapeXml(edge.getValue()) + "\" idref=\"" + edge.getKey() + "\"/>";
			}
			result += "\n\t\t\t\t\t</nt>";
			return result;
			//return "\n\t\t NonTerminal [id=" + id + ", category=" + category + ", edges="+ edges + "]";
		}
	}