'Convenience method to take a BeautifulSoup Tag and extract the text from it
recursively.
@return: A unicode (possibly empty) object'

@classmethod
def tag_to_string(cls, tag):

    if (not tag):
        return ''
    strings = []
    for item in tag.contents:
        if isinstance(item, (NavigableString, CData)):
            strings.append(item.string)
        elif isinstance(item, Tag):
            res = cls.tag_to_string(item)
            if res:
                strings.append(res)
    return u''.join(strings)
