String draw() {
				final StringBuilder builder = new StringBuilder();
				builder
					.append("digraph ")
					.append(_name)
					.append(" {\n");

				_labels.forEach((key, value) ->
					builder
						.append("    ")
						.append(key)
						.append(" [label=\"")
						.append(value.toString().replace("\"", "\\\""))
						.append("\"];\n")
				);

				_edges.forEach(edge ->
					builder
						.append("    ")
						.append(edge)
						.append(";\n")
				);
				builder.append("}\n");

				return builder.toString();
			}
This formatter converts a tree to the .dot representation.
jenetics.ext/src/main/java/io/jenetics/ext/util/TreeFormatter.java