cdm/src/main/java/ucar/nc2/ncml/NcMLWriter.java
public void writeToFile(Element elem, File outFile) throws IOException {
    try (OutputStream outStream = new BufferedOutputStream(new FileOutputStream(outFile, false))) {
      writeToStream(elem, outStream);
    }
  }
public void writeToFile(Element elem, File outFile) throws IOException {
    try (OutputStream outStream = new BufferedOutputStream(new FileOutputStream(outFile, false))) {
      writeToStream(elem, outStream);
    }
  }
Writes an NcML element to an output file.

@param elem  an NcML element.
@param outFile  the file to write the NcML document to.
@throws IOException  if there's any problem writing.