def serialize(self, stream, force_types=False, **kwargs):
        xml_root = self.serialize_bundle(bundle=self.document,
                                         force_types=force_types)
        for bundle in self.document.bundles:
            self.serialize_bundle(bundle=bundle, element=xml_root,
                                  force_types=force_types)
        # No encoding must be specified when writing to String object which
        # does not have the concept of an encoding as it should already
        # represent unicode code points.
        et = etree.ElementTree(xml_root)
        if isinstance(stream, io.TextIOBase):
            stream.write(etree.tostring(et, xml_declaration=True,
                                        pretty_print=True).decode('utf-8'))
        else:
            et.write(stream, pretty_print=True, xml_declaration=True,
                     encoding="UTF-8")
Creates a container (empty object of type application/directory)
dataset/ETHPy150Open trungdong/prov/prov/serializers/provxml.py/ProvXMLSerializer.serialize--crossover with--dataset/ETHPy150Open cschwede/django-swiftbrowser/swiftbrowser/views.py/create_container