public Element generateElement(Document document)
	{
		Element key = document.createElement(mxGraphMlConstants.KEY);
		
		if (!keyName.equals(""))
		{
			key.setAttribute(mxGraphMlConstants.KEY_NAME, keyName);
		}
		key.setAttribute(mxGraphMlConstants.ID, keyId);
		
		if (!keyName.equals(""))
		{
			key.setAttribute(mxGraphMlConstants.KEY_FOR, stringForValue(keyFor));
		}
		
		if (!keyName.equals(""))
		{
			key.setAttribute(mxGraphMlConstants.KEY_TYPE, stringTypeValue(keyType));
		}
		
		if (!keyName.equals(""))
		{
			key.setTextContent(keyDefault);
		}
		
		return key;
	}