code: public void writeXsd(File outFile) {
  
      File folder = outFile.getParentFile();
      if (!folder.isDirectory()) {
        boolean success = folder.mkdirs();
        if (!success) {
          throw new IllegalStateException("Failed to create folder " + folder);
        }
      }
      try (FileOutputStream fos = new FileOutputStream(outFile)) {
        writeXsd(fos);
      } catch (Exception e) {
        throw new IllegalStateException("Failed to generate and write the XSD schema to " + outFile + "!", e);
      }
    }
docs: Generates the XSD (XML Schema Definition) to the given {@link File}.
  
  @param outFile is the {@link File} to write to.