'Creates an elementTree XML structure for a MediaBrowser-style series.xml
returns the resulting data object.
show_obj: a TVShow instance to create the NFO for'

def _show_data(self, show_obj):

    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'Series')
    try:
        myShow = t[int(show_obj.indexerid)]
    except sickbeard.indexer_shownotfound:
        logger.log(((((u'Unable    to    find    show    with    id    ' + str(show_obj.indexerid)) + 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    make    the    NFO"), 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_obj.indexerid)) + u'    on    ') + sickbeard.indexerApi(show_obj.indexer).name) + u',    skipping    it'))
        return False
    if getattr(myShow, u'id', None):
        indexerid = etree.SubElement(tv_node, u'id')
        indexerid.text = str(myShow[u'id'])
    if getattr(myShow, u'seriesname', None):
        SeriesName = etree.SubElement(tv_node, u'SeriesName')
        SeriesName.text = myShow[u'seriesname']
    if getattr(myShow, u'status', None):
        Status = etree.SubElement(tv_node, u'Status')
        Status.text = myShow[u'status']
    if getattr(myShow, u'network', None):
        Network = etree.SubElement(tv_node, u'Network')
        Network.text = myShow[u'network']
    if getattr(myShow, u'airs_time', None):
        Airs_Time = etree.SubElement(tv_node, u'Airs_Time')
        Airs_Time.text = myShow[u'airs_time']
    if getattr(myShow, u'airs_dayofweek', None):
        Airs_DayOfWeek = etree.SubElement(tv_node, u'Airs_DayOfWeek')
        Airs_DayOfWeek.text = myShow[u'airs_dayofweek']
    FirstAired = etree.SubElement(tv_node, u'FirstAired')
    if getattr(myShow, u'firstaired', None):
        FirstAired.text = myShow[u'firstaired']
    if getattr(myShow, u'contentrating', None):
        ContentRating = etree.SubElement(tv_node, u'ContentRating')
        ContentRating.text = myShow[u'contentrating']
        MPAARating = etree.SubElement(tv_node, u'MPAARating')
        MPAARating.text = myShow[u'contentrating']
        certification = etree.SubElement(tv_node, u'certification')
        certification.text = myShow[u'contentrating']
    MetadataType = etree.SubElement(tv_node, u'Type')
    MetadataType.text = u'Series'
    if getattr(myShow, u'overview', None):
        Overview = etree.SubElement(tv_node, u'Overview')
        Overview.text = myShow[u'overview']
    if getattr(myShow, u'firstaired', None):
        PremiereDate = etree.SubElement(tv_node, u'PremiereDate')
        PremiereDate.text = myShow[u'firstaired']
    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:
                ProductionYear = etree.SubElement(tv_node, u'ProductionYear')
                ProductionYear.text = year_text
        except Exception:
            pass
    if getattr(myShow, u'runtime', None):
        RunningTime = etree.SubElement(tv_node, u'RunningTime')
        RunningTime.text = myShow[u'runtime']
        Runtime = etree.SubElement(tv_node, u'Runtime')
        Runtime.text = myShow[u'runtime']
    if getattr(myShow, u'imdb_id', None):
        imdb_id = etree.SubElement(tv_node, u'IMDB_ID')
        imdb_id.text = myShow[u'imdb_id']
        imdb_id = etree.SubElement(tv_node, u'IMDB')
        imdb_id.text = myShow[u'imdb_id']
        imdb_id = etree.SubElement(tv_node, u'IMDbId')
        imdb_id.text = myShow[u'imdb_id']
    if getattr(myShow, u'zap2it_id', None):
        Zap2ItId = etree.SubElement(tv_node, u'Zap2ItId')
        Zap2ItId.text = myShow[u'zap2it_id']
    if (getattr(myShow, u'genre', None) and isinstance(myShow[u'genre'], six.string_types)):
        Genres = etree.SubElement(tv_node, u'Genres')
        for genre in myShow[u'genre'].split(u'|'):
            if genre.strip():
                cur_genre = etree.SubElement(Genres, u'Genre')
                cur_genre.text = genre.strip()
        Genre = etree.SubElement(tv_node, u'Genre')
        Genre.text = u'|'.join([x.strip() for x in myShow[u'genre'].split(u'|') if x.strip()])
    if getattr(myShow, u'network', None):
        Studios = etree.SubElement(tv_node, u'Studios')
        Studio = etree.SubElement(Studios, u'Studio')
        Studio.text = myShow[u'network']
    if getattr(myShow, u'_actors', None):
        Persons = etree.SubElement(tv_node, u'Persons')
        for actor in myShow[u'_actors']:
            if (not ((u'name' in actor) and actor[u'name'].strip())):
                continue
            cur_actor = etree.SubElement(Persons, u'Person')
            cur_actor_name = etree.SubElement(cur_actor, u'Name')
            cur_actor_name.text = actor[u'name'].strip()
            cur_actor_type = etree.SubElement(cur_actor, u'Type')
            cur_actor_type.text = u'Actor'
            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()
    helpers.indentXML(tv_node)
    data = etree.ElementTree(tv_node)
    return data
