@classmethod
def _parse_xml_ports(cls, scanports_data):
    """
            Protected method parsing the list of scanned services from
            a targeted host. This protected method cannot be called directly
            with a string. A <ports/> tag can be directly passed to parse()
            and the below method will be called and return a list of nmap
            scanned services.

            :param scanports_data: <ports> XML tag from a nmap scan
            :type scanports_data: xml.ElementTree.Element or a string

            :return: list of NmapService
        """
    xelement = cls.__format_element(scanports_data)
    rdict = {'ports': [], 'extraports': None}
    for xservice in xelement:
        if xservice.tag == 'port':
            nport = cls._parse_xml_port(xservice)
            rdict['ports'].append(nport)
        elif xservice.tag == 'extraports':
            extraports = cls.__parse_extraports(xservice)
            rdict['extraports'] = extraports
    return rdict
