def get_disks_from_domain(domain_xml):
    """
    From the ElementTree of a domain, get the set of device names for all
    disks assigned to the domain.

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

    Returns
    -------
        set
            The set of device names for all disks assigned to the domain.
    """
    devices = domain_xml.find('./devices')
    if devices is None:
        return None

    disks = []
    for disk in devices.findall('./disk'):
        try:
            disks.append(disk.find('./source').attrib['dev'])
        except Exception:
            pass
    return set(disks)