Given an integer bitmap and an enumerated type, build
    a set that includes zero or more enumerated type values
    corresponding to the bitmap.

def _unpack_bitmap(bitmap, xenum):
    '''
    Given an integer bitmap and an enumerated type, build
    a set that includes zero or more enumerated type values
    corresponding to the bitmap.
    '''
    unpacked = set()
    for enval in xenum:
        if enval.value & bitmap == enval.value:
            unpacked.add(enval)
    return unpacked