public static void write(@NotNull Element element, @NotNull Path file) throws IOException {
    Files.createDirectories(file.getParent());
    try (BufferedWriter writer = Files.newBufferedWriter(file)) {
      createOutputter("\n").output(element, writer);
    }
    catch (NullPointerException ex) {
      getLogger().error(ex);
      printDiagnostics(element, "");
    }
  }
public static void write(@NotNull Element element, @NotNull Path file)