public Document setRootElement(Element rootElement) {
    int index = content.indexOfFirstElement();
    if (index < 0) {
      content.add(rootElement);
    }
    else {
      content.set(index, rootElement);
    }
    return this;
  }
public Document setRootElement(Element rootElement)