code: protected Element createGroup(String namespace, Object parent, Object group, String type) {
  		Element parentElement;
  		if (parent == null) {
  			parentElement = getRootElement();
  		} else {
  			parentElement = getGroup(parent);
  		}
  		if (parentElement == null) {
  			return null;
  		} else {
  			Element element;
  			String id = Dom.createUniqueId();
  			if (group instanceof PaintableGroup) {
  				id = Dom.assembleId(id, ((PaintableGroup) group).getGroupName());
  			}
  			groupToId.put(group, id);
  			idToGroup.put(id, group);
  			if (Dom.NS_HTML.equals(namespace)) {
  				element = Dom.createElement("div", id);
  			} else {
  				element = Dom.createElementNS(namespace, type, id);
  			}
  			parentElement.appendChild(element);
  			return element;
  		}
  	}
docs: Generic creation method for group elements.
  
  @param namespace
  the name space (HTML, SVG or VML,...)
  @param parent
  the parent group
  @param group
  group
  @param type
  type
  @return the newly created group element or null if creation failed