try {
if (docxFile.getPath().toLowerCase().endsWith(".xml") ) {
return saveFlatOPC(new FileOutputStream(docxFile));
} else return save(new FileOutputStream(docxFile));
} catch (FileNotFoundException e) {
throw new Docx4JException("Failed to save package to path " + docxFile.getPath(), e);
}
}