+ struct string zip_cmd;
+ struct string rm_cmd;
+ struct odt_driver_ext *x = this->ext;
+
+ xmlTextWriterEndElement (x->content_wtr); /* office:text */
+ xmlTextWriterEndElement (x->content_wtr); /* office:body */
+ xmlTextWriterEndElement (x->content_wtr); /* office:document-content */
+
+ xmlTextWriterEndDocument (x->content_wtr);
+ xmlFreeTextWriter (x->content_wtr);
+
+ /* Zip up the directory */
+ ds_init_empty (&zip_cmd);
+ ds_put_format (&zip_cmd, "cd %s ; zip -r ../pspp.odt . > /dev/null", x->dirname);
+ system (ds_cstr (&zip_cmd));
+ ds_destroy (&zip_cmd);