public String toString(String echo) {
		String response = "";

        if ( echo == null ) {
            response = "<TPTAResponse version=\"" + this.version + "\">\n<entities>";
        } else {
            response = "<TPTAResponse version=\"" + this.version + 
                                        "\">\n<text language=\"" + this.language + 
                                        "\">" + this.text + "</text>\n<entities>";
        }

		for (NamedEntity entity : this.entities) {
			response += "\n";
			if (entity instanceof PersonEntity) {
				response += "<person>" + entity.getValue() + "</person>";
			} else if (entity instanceof OrganisationEntity) {
				response += "<organisation>" + entity.getValue() + "</organisation>";
			} else if (entity instanceof LocationEntity) {
				response += "<location>" + entity.getValue() + "</location>";
			} else if (entity instanceof OtherEntity) {
				response += "<other>" + entity.getValue() + "</other>";
			} else {
				response += "<unknown>" + entity.getValue() + "</unknown>";
			}
			response += "\n";
		}
		response += "</entities>\n</TPTAResponse>";
		return response;
	}