def METHOD_NAME(element, sector):
    """
    Helper function for transaction()
    """
    if has_data(sector, ['code', 'vocabulary', 'vocabulary_uri', 'text', ]):
        sector_element = etree.SubElement(element, "sector")
        if sector.code:
            sector_element.attrib['code'] = sector.code
        if sector.vocabulary:
            sector_element.attrib['vocabulary'] = sector.vocabulary
        if sector.vocabulary_uri:
            sector_element.attrib['vocabulary-uri'] = sector.vocabulary_uri
        if sector.text:
            narrative_element = etree.SubElement(sector_element, "narrative")
            narrative_element.text = sector.text
    return element