public static void writeElement(@NotNull Element element, Writer writer, String lineSeparator) throws IOException {
    try {
      createOutputter(lineSeparator).output(element, writer);
    }
    catch (NullPointerException ex) {
      getLogger().error(ex);
      printDiagnostics(element, "");
    }
  }
public static void writeElement(@NotNull Element element, Writer writer, String lineSeparator)