code: private void ensureId(final Element element) {
          final String id = element.getId();
          if (id == null || id.isEmpty()) {
              element.setId(Document.get().createUniqueId());
          }
      }
docs: Ensures the given element has a non-empty id.
  
  @param element The element being examined.
  @see Document#createUniqueId()