'Write the various xml files into the zip archive.'

def write_data(self, archive, as_template=False):

    archive.writestr(ARC_CONTENT_TYPES, write_content_types(self.workbook, as_template=as_template))
    archive.writestr(ARC_ROOT_RELS, write_root_rels(self.workbook))
    archive.writestr(ARC_WORKBOOK_RELS, write_workbook_rels(self.workbook))
    archive.writestr(ARC_APP, write_properties_app(self.workbook))
    archive.writestr(ARC_CORE, write_properties(self.workbook.properties))
    if self.workbook.loaded_theme:
        archive.writestr(ARC_THEME, self.workbook.loaded_theme)
    else:
        archive.writestr(ARC_THEME, write_theme())
    archive.writestr(ARC_WORKBOOK, write_workbook(self.workbook))
    if self.workbook.vba_archive:
        vba_archive = self.workbook.vba_archive
        for name in vba_archive.namelist():
            for s in ARC_VBA:
                if match(s, name):
                    archive.writestr(name, vba_archive.read(name))
                    break
    self._write_charts(archive)
    self._write_images(archive)
    self._write_worksheets(archive)
    self._write_string_table(archive)
    self._write_external_links(archive)
    archive.writestr(ARC_STYLE, self.style_writer.write_table())
