code: public static void writeEdge(Node src, Node tgt, Edge edge,
              PrintWriter writer) {
          StringBuilder sb = new StringBuilder();
          RelationshipType rel = edge.rel;
          String reldispval = rel.getDisplayValue();
          sb.append("  <edge label='");
          String dispval = format(EDGE_LABEL, src.label, rel, tgt.label);
          sb.append(dispval);
          sb.append("' source='");
          sb.append(edge.source.toString());
          sb.append("' target='");
          sb.append(edge.target.toString());
          sb.append("'>\n");
          sb.append("    <att name='relationship type'");
          sb.append(" value='");
          sb.append(reldispval);
          sb.append("' />\n");
  
          // Edge graphics
          String color = color(rel);
          String graphics = format(EDGE_GRAPHICS, 1, color, 1, reldispval);
          sb.append(graphics);
  
          sb.append("  </edge>\n");
          writer.write(sb.toString());
      }
docs: Write an XGMML &lt;edge&gt; from {@code edge} properties.
  
  @param edge {@link Edge}, the edge to write
  @param writer {@link PrintWriter}, the writer