@classmethod
def __parse_script(cls, script_data):
    """
            Private method parsing the data from NSE scripts output

            :param script_data: portion of XML describing the results of the
            script data
            :type script_data: xml.ElementTree.Element or a string

            :return: python dict holding scripts output
        """
    _script_dict = cls.__format_attributes(script_data)
    _elt_dict = {}
    for script_elem in script_data:
        if script_elem.tag == 'elem':
            _elt_dict.update({script_elem.get('key'): script_elem.text})
        elif script_elem.tag == 'table':
            tdict = {}
            for telem in script_elem:
                tkey = telem.get('key')
                if tkey in tdict:
                    if not isinstance(tdict[tkey], list):
                        tdict[tkey] = [tdict[tkey]]
                    tdict[tkey].append(telem.text)
                else:
                    tdict[tkey] = telem.text
            skey = script_elem.get('key')
            if skey in _elt_dict:
                if not isinstance(_elt_dict[skey], list):
                    _elt_dict[skey] = [_elt_dict[skey]]
                _elt_dict[skey].append(tdict)
            else:
                _elt_dict[skey] = tdict
    _script_dict['elements'] = _elt_dict
    return _script_dict
