code: def filtered_elements(self, model):
          
          if isinstance(model, self.element_type):
              yield model
          yield from (e for e in model.eAllContents() if isinstance(e, self.element_type))
docs: Return iterator based on `element_type`.