protected void printDeclaration(Writer out, Document doc,
                                  String encoding) throws IOException {

    // Only print the declaration if it's not being omitted
    // Assume 1.0 version
    out.write("<?xml version=\"1.0\"");
    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
    out.write(getLineSeparator());
  }
protected void printDeclaration(Writer out, Document doc,
                                  String encoding)