private void printDeclaration(Writer out, String encoding) throws IOException {
    // Only print the declaration if it's not being omitted
    if (!userFormat.omitDeclaration) {
      // assume 1.0 version
      out.write("<?xml version=\"1.0\"");
      if (!userFormat.omitEncoding) {
        out.write(" encoding=\"" + encoding + "\"");
      }
      out.write("?>");

      // Print new line after decl always, even if no other new lines
      // Helps the output look better and is semantically
      // inconsequential
      writeLineSeparator(out);
    }
  }
private void printDeclaration(Writer out, String encoding)