code: def write_Composition(composition, filename, zip=False):
      
      text = from_Composition(composition)
      if not zip:
          f = open(filename + '.xml', 'w')
          f.write(text)
          f.close()
      else:
          import zipfile
          import os
          zf = zipfile.ZipFile(filename + '.mxl', mode='w',
                               compression=zipfile.ZIP_DEFLATED)
          zi = zipfile.ZipInfo('META-INF' + os.sep + 'container.xml')
          zi.external_attr = 0660 << 16L
          zf.writestr(zi,
                      "<?xml version='1.0' encoding='UTF-8'?>"
                      "<container><rootfiles><rootfile full-path='{0}.xml'/>"
                      "</rootfiles></container>".format(filename))
          zi = zipfile.ZipInfo(filename + '.xml')
          zi.external_attr = 0660 << 16L
          zf.writestr(zi, text)
          zf.close()
docs: Create an XML file (or MXL if compressed) for a given composition.