public XMLElement save() {
        if (style != null || color != null || width != WIDTH_PARENT) {
            XMLElement edge = new XMLElement();
            edge.setName("edge");

            if (style != null) {
                edge.setAttribute("STYLE", style);
            }
            if (color != null) {
                edge.setAttribute("COLOR", Tools.colorToXml(color));
            }
            if (width != WIDTH_PARENT) {
                if (width == WIDTH_THIN)
                    edge.setAttribute("WIDTH", EDGE_WIDTH_THIN_STRING);
                else
                    edge.setAttribute("WIDTH", Integer.toString(width));
            }
            return edge;
        }
        return null;
    }