code: public String getId(Element element) {
  
      String id = element.getId();
      if ((id == null) || (id.length() == 0)) {
        id = DOM.createUniqueId();
        element.setId(id);
      }
      return id;
    }
docs: This method gets the ID of the given {@link Element}. If the {@link Element} {@link Element#getId() has
  no ID} set, this method will {@link DOM#createUniqueId() create a unique ID} and
  {@link Element#setId(String) assign} it to the given {@link Element}.
  
  @param element is the {@link Element} for which the ID is requested.
  @return the (unique) ID of the {@link Element}. Created if not set.