code: protected boolean appendDocumentXmlDeclaration(StringBuilder sb, Document doc) {
          if ("1.0".equals(doc.getXmlVersion()) && doc.getXmlEncoding() == null && !doc.getXmlStandalone()) {
              // only default values => ignore
              return false;
          }
          sb.append("<?xml version=\"");
          sb.append(doc.getXmlVersion());
          sb.append("\"");
          if (doc.getXmlEncoding() != null) {
              sb.append(" encoding=\"");
              sb.append(doc.getXmlEncoding());
              sb.append("\"");
          }
          if (doc.getXmlStandalone()) {
              sb.append(" standalone=\"yes\"");
          }
          sb.append("?>");
          return true;
      }
docs: Appends the XML declaration for {@link #getShortString} or {@link #appendFullDocumentHeader} if it contains
  non-default values.
  
  @param sb the builder to append to
  @return true if the XML declaration has been appended
  
  @since XMLUnit 2.4.0