tiny xor utility function