code: public Element createOrUpdateElement(Object parent, String name, String type, Style style, boolean generateId) {
  		Element element;
  		// check existence
  		if (name != null) {
  			if (!generateId) {
  				element = Dom.getElementById(name);
  			} else {
  				element = getElement(parent, name);
  			}
  		} else {
  			return null;
  		}
  		if (element == null) {
  			// Element was not found, so create it:
  			element = createElement(parent, name, type, style, generateId);
  		} else {
  			// Element was found, so update it:
  			applyStyle(element, style);
  		}
  		// no luck !
  		if (element == null) {
  			return null;
  		}
  		return element;
  	}
docs: Create or update an element in the DOM. The id will be generated.
  
  @param parent
  the parent group
  @param name
  the local group name of the element (should be unique within the group)
  @param type
  the type of the element (tag name, e.g. 'image')
  @param style
  The style to apply on the element.
  @param generateId
  true if a unique id may be generated. If false, the name will be used as id and should therefore be
  unique
  @return the created or updated element or null if creation failed or name was null