'Creates an elementTree XML structure for an KODI-style tvshow.nfo and
returns the resulting data object.
show_obj: a TVShow instance to create the NFO for'

def _show_data(self, show_obj):

    show_ID = show_obj.indexerid
    indexer_lang = show_obj.lang
    lINDEXER_API_PARMS = sickbeard.indexerApi(show_obj.indexer).api_params.copy()
    lINDEXER_API_PARMS[u'actors'] = True
    lINDEXER_API_PARMS[u'language'] = (indexer_lang or sickbeard.INDEXER_DEFAULT_LANGUAGE)
    if show_obj.dvdorder:
        lINDEXER_API_PARMS[u'dvdorder'] = True
    t = sickbeard.indexerApi(show_obj.indexer).indexer(**lINDEXER_API_PARMS)
    tv_node = etree.Element(u'tvshow')
    try:
        myShow = t[int(show_ID)]
    except sickbeard.indexer_shownotfound:
        logger.log(((((u'Unable    to    find    show    with    id    ' + str(show_ID)) + u'    on    ') + sickbeard.indexerApi(show_obj.indexer).name) + u',    skipping    it'), logger.ERROR)
        raise
    except sickbeard.indexer_error:
        logger.log(((u'' + sickbeard.indexerApi(show_obj.indexer).name) + u"    is    down,    can't    use    its    data    to    add    this    show"), logger.ERROR)
        raise
    if (not (getattr(myShow, u'seriesname', None) and getattr(myShow, u'id', None))):
        logger.log(((((u'Incomplete    info    for    show    with    id    ' + str(show_ID)) + u'    on    ') + sickbeard.indexerApi(show_obj.indexer).name) + u',    skipping    it'))
        return False
    title = etree.SubElement(tv_node, u'title')
    title.text = myShow[u'seriesname']
    if getattr(myShow, u'rating', None):
        rating = etree.SubElement(tv_node, u'rating')
        rating.text = myShow[u'rating']
    if getattr(myShow, u'firstaired', None):
        try:
            year_text = str(datetime.datetime.strptime(myShow[u'firstaired'], dateFormat).year)
            if year_text:
                year = etree.SubElement(tv_node, u'year')
                year.text = year_text
        except Exception:
            pass
    if getattr(myShow, u'overview', None):
        plot = etree.SubElement(tv_node, u'plot')
        plot.text = myShow[u'overview']
    if getattr(myShow, u'id', None):
        episodeguide = etree.SubElement(tv_node, u'episodeguide')
        episodeguideurl = etree.SubElement(episodeguide, u'url')
        episodeguideurl.text = ((sickbeard.indexerApi(show_obj.indexer).config[u'base_url'] + str(myShow[u'id'])) + u'/all/en.zip')
    if getattr(myShow, u'contentrating', None):
        mpaa = etree.SubElement(tv_node, u'mpaa')
        mpaa.text = myShow[u'contentrating']
    if getattr(myShow, u'id', None):
        indexerid = etree.SubElement(tv_node, u'id')
        indexerid.text = str(myShow[u'id'])
    if (getattr(myShow, u'genre', None) and isinstance(myShow[u'genre'], six.string_types)):
        for genre in self._split_info(myShow[u'genre']):
            cur_genre = etree.SubElement(tv_node, u'genre')
            cur_genre.text = genre
    if (u'country_codes' in show_obj.imdb_info):
        for country in self._split_info(show_obj.imdb_info[u'country_codes']):
            try:
                cur_country_name = Country(country.upper()).name.title()
            except Exception:
                continue
            cur_country = etree.SubElement(tv_node, u'country')
            cur_country.text = cur_country_name
    if getattr(myShow, u'firstaired', None):
        premiered = etree.SubElement(tv_node, u'premiered')
        premiered.text = myShow[u'firstaired']
    if getattr(myShow, u'network', None):
        studio = etree.SubElement(tv_node, u'studio')
        studio.text = myShow[u'network'].strip()
    if (getattr(myShow, u'writer', None) and isinstance(myShow[u'writer'], six.string_types)):
        for writer in self._split_info(myShow[u'writer']):
            cur_writer = etree.SubElement(tv_node, u'credits')
            cur_writer.text = writer
    if (getattr(myShow, u'director', None) and isinstance(myShow[u'director'], six.string_types)):
        for director in self._split_info(myShow[u'director']):
            cur_director = etree.SubElement(tv_node, u'director')
            cur_director.text = director
    if getattr(myShow, u'_actors', None):
        for actor in myShow[u'_actors']:
            cur_actor = etree.SubElement(tv_node, u'actor')
            if ((u'name' in actor) and actor[u'name'].strip()):
                cur_actor_name = etree.SubElement(cur_actor, u'name')
                cur_actor_name.text = actor[u'name'].strip()
            else:
                continue
            if ((u'role' in actor) and actor[u'role'].strip()):
                cur_actor_role = etree.SubElement(cur_actor, u'role')
                cur_actor_role.text = actor[u'role'].strip()
            if ((u'image' in actor) and actor[u'image'].strip()):
                cur_actor_thumb = etree.SubElement(cur_actor, u'thumb')
                cur_actor_thumb.text = actor[u'image'].strip()
    helpers.indentXML(tv_node)
    data = etree.ElementTree(tv_node)
    return data
