// save model if needed
if (structuredModel != null
&& !structuredModel.isSharedForEdit()
&& structuredModel.isSaveNeeded())
structuredModel.save();
} finally {
// ensureClosed(outputStream, null);
// release from model manager
if (structuredModel != null)
structuredModel.releaseFromEdit();