code: protected boolean appendDocumentType(StringBuilder sb, DocumentType type) {
          if (type == null) {
              return false;
          }
          sb.append("<!DOCTYPE ").append(type.getName());
          boolean hasNoPublicId = true;
          if (type.getPublicId() != null && type.getPublicId().length() > 0) {
              sb.append(" PUBLIC \"").append(type.getPublicId()).append('"');
              hasNoPublicId = false;
          }
          if (type.getSystemId() != null && type.getSystemId().length() > 0) {
              if (hasNoPublicId) {
                  sb.append(" SYSTEM");
              }
              sb.append(" \"").append(type.getSystemId()).append("\"");
          }
          sb.append(">");
          return true;
      }
docs: Appends the XML DOCTYPE for {@link #getShortString} or {@link #appendFullDocumentHeader} if present.
  
  @param sb the builder to append to
  @param type the document type
  @return true if the DOCTPYE has been appended
  
  @since XMLUnit 2.4.0