def METHOD_NAME(self, filter=None, shift=0):
    """
    Iterate the nested structure as a list of strings with appropriate
    indentations for each level of structure.
    """
    element = 0
    # go through the list twice, first time print out all top level
    # messages
    for item in self:
        if not isinstance(item, _ErrList):
            if filter is None or filter(item):
                yield item[0], indent(item[1], shift=shift)
    # second time go through the next level items, each of the next level
    # must present, even it has nothing.
    for item in self:
        if isinstance(item, _ErrList):
            next_lines = item.METHOD_NAME(filter=filter, shift=shift + 1)
            try:
                first_line = next(next_lines)
            except StopIteration:
                first_line = None
            if first_line is not None:
                if self.unit:
                    # This line is sort of a header for the next level in
                    # the hierarchy
                    yield None, indent(f"{self.unit} {element}:", shift=shift)
                yield first_line
            yield from next_lines
            element += 1