public static @NotNull String writeDocument(@NotNull Document document, String lineSeparator) {
    try {
      StringWriter writer = new StringWriter();
      writeDocument(document, writer, lineSeparator);
      return writer.toString();
    }
    catch (IOException ignored) {
      // Can't be
      return "";
    }
  }
public static @NotNull String writeDocument(@NotNull Document document, String lineSeparator)