apply xor in test