code: def filter(self, *, type_=None, lang=None, attrs={}):
          
          result = self
          if type_ is not None:
              result = self._filter_type(result, type_)
          if lang is not None:
              result = self._filter_lang(result, lang)
          if attrs:
              result = self._filter_attrs(result, attrs)
          return result
docs: Return an iterable which produces a sequence of the elements inside
          this :class:`XSOList`, filtered by the criteria given as arguments. The
          function starts with a working sequence consisting of the whole list.
  
          If `type_` is not :data:`None`, elements which are not an instance of
          the given type are excluded from the working sequence.
  
          If `lang` is not :data:`None`, it must be either a
          :class:`~.structs.LanguageRange` or an iterable of language ranges. The
          set of languages present among the working sequence is determined and
          used for a call to
          :class:`~.structs.lookup_language`. If the lookup returns a language,
          all elements whose :attr:`lang` is different from that value are
          excluded from the working sequence.
  
          .. note::
  
             If an iterable of language ranges is given, it is evaluated into a
             list. This may be of concern if a huge iterable is about to be used
             for language ranges, but it is an requirement of the
             :class:`~.structs.lookup_language` function which is used under the
             hood.
  
          .. note::
  
             Filtering by language assumes that the elements have a
             :class:`~aioxmpp.xso.LangAttr` descriptor named ``lang``.
  
          If `attrs` is not empty, the filter iterates over each `key`-`value`
          pair. For each iteration, all elements which do not have an attribute
          of the name in `key` or where that attribute has a value not equal to
          `value` are excluded from the working sequence.
  
          In general, the iterable returned from :meth:`filter` can only be used
          once. It is dynamic in the sense that changes to elements which are in
          the list *behind* the last element returned from the iterator will
          still be picked up when the iterator is resumed.