def get_interfaces_from_domain(domain_xml):
    """
    From the ElementTree of a domain, get a map of all network interfaces.

    Parameters
    ----------
    domain_xml: ElementTree
        The xml representation of the domain.

    Returns
    -------
        dict
            All the network interfaces, as {mac_address: device_name}.
    """
    if domain_xml is None:
        return {}

    devices = domain_xml.find('./devices')
    if devices is None:
        return {}

    ifaces = {}
    for iface in devices.findall('./interface'):
        mac = iface.find('./mac')
        source = iface.find('./source')
        ifaces[mac.attrib['address'].lower()] = source.attrib.get('dev', '')
    return ifaces