docs: def transform_collection(collection_dir):
      """ Given an unzipped collection generate a giant HTML file representing
          the entire collection (including loading and converting individual modules) """
  
      collxml_file = open(os.path.join(collection_dir, 'collection.xml'))
      collxml_html = transform_collxml(collxml_file)
  
      # For each included module, parse and convert it
      for node in INCLUDE_XPATH(collxml_html):
          href = node.attrib['href']
          module = href.split('@')[0]
          # version = None # We don't care about version
          module_dir = os.path.join(collection_dir, module)
  
          # By default, use the index_auto_generated.cnxml file for the module
          module_path = os.path.join(module_dir, 'index_auto_generated.cnxml')
          if not os.path.exists(module_path):
            module_path = os.path.join(module_dir, 'index.cnxml')
  
          module_html = transform_cnxml(module_path)
  
          # Replace the include link with the body of the module
          module_body = MODULE_BODY_XPATH(module_html)
  
          node.getparent().replace(node, module_body[0])
      return collxml_html