code: protected void appendFullDocumentHeader(StringBuilder sb, Document doc) {
          if (appendDocumentXmlDeclaration(sb, doc)) {
              sb.append("\n");
          }
          if (appendDocumentType(sb, doc.getDoctype())) {
              sb.append("\n");
          }
          appendOnlyElementStartTagWithAttributes(sb, doc.getDocumentElement());
      }
docs: Appends the XML declaration and DOCTYPE if present as well as the document's root element for {@link
  #getFullFormattedXml}.
  
  @param sb the builder to append to
  @param doc the document to format
  
  @since XMLUnit 2.4.0