docs: def default(self, obj):
          """Implement this method in a subclass such that it returns a tree for ``o``."""
          if isinstance(obj, BioCDocument):
              return encode_document(obj)
          if isinstance(obj, BioCCollection):
              return encode_collection(obj)
          raise TypeError(f'Object of type {obj.__class__.__name__} is not BioC XML serializable')