import functools


def xml_to_text(func):
    """
    Transforms a function that would return an XML element into a function
    that returns the text content of the XML element as a string.
    """
    @functools.wraps(func)
    def inner(*args, **kwargs):
        result = func(*args, **kwargs)
        if result is None:
            return ''
        return result.firstChild.nodeValue
    return inner