public Element generateElement(Document document)
	{
		Element graph = document.createElement(mxGraphMlConstants.GRAPH);

		if (!id.equals(""))
		{
			graph.setAttribute(mxGraphMlConstants.ID, id);
		}
		if (!edgedefault.equals(""))
		{
			graph.setAttribute(mxGraphMlConstants.EDGE_DEFAULT, edgedefault);
		}

		for (mxGraphMlNode node : nodes)
		{
			Element nodeElement = node.generateElement(document);
			graph.appendChild(nodeElement);
		}

		for (mxGraphMlEdge edge : edges)
		{
			Element edgeElement = edge.generateElement(document);
			graph.appendChild(edgeElement);
		}

		return graph;
	}