}else{
String path = ConfigObj.getActiveInstance().getStoragePathTemplates();
String filename = path + File.separator + this.getName()+".templatez";
ZipWriter zip = new ZipWriter(filename, DatasoulMainForm.FILE_FORMAT_VERSION);
Node node = this.writeObject(zip);
Document doc = node.getOwnerDocument();
doc.appendChild( node); // Add Root to Document
Source source = new DOMSource(doc);
// Prepare the output file
Result result = new StreamResult(zip.getOutputStream());
// Write the DOM document to the file
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.setOutputProperty(OutputKeys.INDENT, "yes");
xformer.transform(source, result);
// Now, store meta data
DisplayTemplateMetadata meta = new DisplayTemplateMetadata(this);
meta.setFilename(filename);
zip.startMetadata();
meta.save(zip);
TemplateManager.getInstance().addTemplateMetadata(meta);
// Done, write images and close it
zip.close();
}
}