Parse the <host> element of the connection capabilities XML.

def _parse_caps_host(host):
    '''
    Parse the <host> element of the connection capabilities XML.
    '''
    result = {}
    for child in host:

        if child.tag == 'uuid':
            result['uuid'] = child.text

        elif child.tag == 'cpu':
            cpu = {
                'arch': child.find('arch').text if child.find('arch') is not None else None,
                'model': child.find('model').text if child.find('model') is not None else None,
                'vendor': child.find('vendor').text if child.find('vendor') is not None else None,
                'features': [feature.get('name') for feature in child.findall('feature')],
                'pages': [{'size': '{} {}'.format(page.get('size'), page.get('unit', 'KiB'))}
                          for page in child.findall('pages')]
            }
            # Parse the cpu tag
            microcode = child.find('microcode')
            if microcode is not None:
                cpu['microcode'] = microcode.get('version')

            topology = child.find('topology')
            if topology is not None:
                cpu['sockets'] = int(topology.get('sockets'))
                cpu['cores'] = int(topology.get('cores'))
                cpu['threads'] = int(topology.get('threads'))
            result['cpu'] = cpu

        elif child.tag == "power_management":
            result['power_management'] = [node.tag for node in child]

        elif child.tag == "migration_features":
            result['migration'] = {
                'live': child.find('live') is not None,
                'transports': [node.text for node in child.findall('uri_transports/uri_transport')]
            }

        elif child.tag == "topology":
            result['topology'] = {
                'cells': [_parse_caps_cell(cell) for cell in child.findall('cells/cell')]
            }

        elif child.tag == 'cache':
            result['cache'] = {
                'banks': [_parse_caps_bank(bank) for bank in child.findall('bank')]
            }

    result['security'] = [{
            'model': secmodel.find('model').text if secmodel.find('model') is not None else None,
            'doi': secmodel.find('doi').text if secmodel.find('doi') is not None else None,
            'baselabels': [{'type': label.get('type'), 'label': label.text}
                           for label in secmodel.findall('baselabel')]
        }
        for secmodel in host.findall('secmodel')]

    return result