'Extract networks from a compute node XML representation.
Extract network descriptions from a compute node XML representation,
converting each network to an OpenNebulaNetwork object.
:type  compute: :class:`ElementTree`
:param compute: XML representation of a compute node.
:rtype:  ``list`` of :class:`OpenNebulaNetwork`
:return: List of virtual networks attached to the compute node.'

def _extract_networks(self, compute):

    networks = []
    for element in compute.findall('NIC'):
        network = element.find('NETWORK')
        network_id = network.attrib['href'].partition('/network/')[2]
        networks.append(OpenNebulaNetwork(id=network_id, name=network.attrib.get('name', None), address=element.findtext('IP'), size=1, driver=self.connection.driver, extra={'mac': element.findtext('MAC')}))
    return networks
