def decode(self, fp: TextIO) -> BioCCollection:
        """
        Deserialize ``fp`` to a BioC collection object.

        Args:
            fp: a ``.read()``-supporting file-like object containing a BioC collection

        Returns:
            an object of BioCollection
        """
        # utf8_parser = etree.XMLParser(encoding='utf-8')
        tree = etree.parse(fp)
        collection = self.__parse_collection(tree.getroot())
        collection.encoding = tree.docinfo.encoding
        collection.standalone = tree.docinfo.standalone
        collection.version = tree.docinfo.xml_version
        return collection