def parse_tags(self, element, trigger):
response = []<EOL>head = element.text if isinstance(element.text, string_types) else None<EOL>if head:<EOL><INDENT>if head.strip():<EOL><INDENT>head = newlines_to_spaces(head)<EOL>self._log.debug('<STR_LIT>'.format(text=head))<EOL><DEDENT>response.append(head)<EOL><DEDENT>def append_tail(e):<EOL><INDENT>tail = e.tail if isinstance(e.tail, string_types) else None<EOL>if tail:<EOL><INDENT>if tail.strip():<EOL><INDENT>tail = newlines_to_spaces(tail)<EOL>self._log.debug('<STR_LIT>'.format(text=tail))<EOL><DEDENT>response.append(tail)<EOL><DEDENT><DEDENT>for child in element:<EOL><INDENT>if child.tag == '<STR_LIT>':<EOL><INDENT>star_index = int_attribute(child, '<STR_LIT:index>', <NUM_LIT:1>)<EOL>star_format = attribute(child, '<STR_LIT>', '<STR_LIT:none>')<EOL>self._log.debug('<STR_LIT>'.format(no=star_index))<EOL>response.append(Star(trigger, star_index, star_format))<EOL>append_tail(child)<EOL>continue<EOL><DEDENT>if child.tag not in self._tags:<EOL><INDENT>self._log.warn('<STR_LIT>'.format(tag=child.tag))<EOL>continue<EOL><DEDENT>tag = self._tags[child.tag]<EOL>self._log.debug('<STR_LIT>'.format(tag=child.tag.capitalize()))<EOL>response.append(tag(trigger, child))<EOL>append_tail(child)<EOL><DEDENT>return response<EOL>
Parse tags in an XML element
:param element: The response [message] XML element
:type  element: etree._Element

:return: A list of strings and Tag objects in the order they are parsed
:rtype : list of (str or parser.tags.tag,Tag)