'@elem: The element in the etree that we are working on.
@stylizer: The style information attached to the element.'

def dump_text(self, elem, stylizer, page):

    if ((not isinstance(elem.tag, basestring)) or (namespace(elem.tag) != XHTML_NS)):
        p = elem.getparent()
        if ((p is not None) and isinstance(p.tag, basestring) and (namespace(p.tag) == XHTML_NS) and elem.tail):
            return [elem.tail]
        return [u'']
    text = [u'']
    style = stylizer.style(elem)
    tags = []
    tag = barename(elem.tag)
    attribs = elem.attrib
    if (tag == u'body'):
        tag = u'div'
    tags.append(tag)
    if ((style[u'display'] in (u'none', u'oeb-page-head', u'oeb-page-foot')) or (style[u'visibility'] == u'hidden')):
        return [u'']
    if (u'class' in attribs):
        del attribs[u'class']
    if (u'style' in attribs):
        del attribs[u'style']
    at = u''
    for (k, v) in attribs.items():
        at += (u'    %s="%s"' % (k, prepare_string_for_xml(v, attribute=True)))
    text.append((u'<%s%s' % (tag, at)))
    if (tag in SELF_CLOSING_TAGS):
        text.append(u'    />')
    else:
        text.append(u'>')
    if (style[u'font-weight'] in (u'bold', u'bolder')):
        text.append(u'<b>')
        tags.append(u'b')
    if (style[u'font-style'] == u'italic'):
        text.append(u'<i>')
        tags.append(u'i')
    if (style[u'text-decoration'] == u'underline'):
        text.append(u'<u>')
        tags.append(u'u')
    if (style[u'text-decoration'] == u'line-through'):
        text.append(u'<s>')
        tags.append(u's')
    if (hasattr(elem, u'text') and elem.text):
        text.append(self.prepare_string_for_html(elem.text))
    for item in elem:
        text += self.dump_text(item, stylizer, page)
    tags.reverse()
    for t in tags:
        if (t not in SELF_CLOSING_TAGS):
            text.append((u'</%s>' % t))
    if (hasattr(elem, u'tail') and elem.tail):
        text.append(self.prepare_string_for_html(elem.tail))
    return text
