<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def iter_children(self, key=None):
 u"""Iterates over children. :param key: A key for filtering children by tagname. """

        tag = None

        if key:
            tag = self._get_aliases().get(key)

            if not tag:
                raise KeyError(key)

        for child in self._xml.iterchildren(tag=tag):
            if len(child):
                yield self.__class__(child)
            else:
                yield Literal(child)