'Return processed and validated children list.
Output: array'

def get_item_children(self, rating_key=''):

    children_data = self.get_children_list(rating_key, output_format='xml')
    try:
        xml_head = children_data.getElementsByTagName('MediaContainer')
    except Exception as e:
        logger.warn((u'PlexPy    Pmsconnect    ::    Unable    to    parse    XML    for    get_children_list:    %s.' % e))
        return []
    children_list = []
    for a in xml_head:
        if a.getAttribute('size'):
            if (a.getAttribute('size') == '0'):
                logger.debug(u'PlexPy    Pmsconnect    ::    No    children    data.')
                children_list = {'children_count': '0', 'children_list': []}
                return children_list
        result_data = []
        if a.getElementsByTagName('Directory'):
            result_data = a.getElementsByTagName('Directory')
        if a.getElementsByTagName('Video'):
            result_data = a.getElementsByTagName('Video')
        if a.getElementsByTagName('Track'):
            result_data = a.getElementsByTagName('Track')
        section_id = helpers.get_xml_attr(a, 'librarySectionID')
        if result_data:
            for result in result_data:
                children_output = {'section_id': section_id, 'rating_key': helpers.get_xml_attr(result, 'ratingKey'), 'media_index': helpers.get_xml_attr(result, 'index'), 'title': helpers.get_xml_attr(result, 'title'), 'thumb': helpers.get_xml_attr(result, 'thumb'), 'parent_thumb': helpers.get_xml_attr(a, 'thumb'), 'duration': helpers.get_xml_attr(result, 'duration')}
                children_list.append(children_output)
    output = {'children_count': helpers.get_xml_attr(xml_head[0], 'size'), 'children_type': helpers.get_xml_attr(xml_head[0], 'viewGroup'), 'title': helpers.get_xml_attr(xml_head[0], 'title2'), 'children_list': children_list}
    return output
