public String outputString(Document doc) {
    StringWriter out = new StringWriter();
    try {
      // output() flushes
      output(doc, out);
    }
    catch (IOException ignored) {
    }
    return out.toString();
  }
public String outputString(Document doc)