import six


def _read_xml_element(element, xml_ns, tag_name, default=""):
    """ Helper method to read text from an element. """
    try:
        text = element.find(xml_ns + tag_name).text
        if isinstance(text, six.text_type):
            return text
        else:
            return text.decode('utf-8')

    except AttributeError:
        return default