moved test on xor into util