The bitwise or will return the following (just a normal or)
1 2 3
0011
or 1001
1011
The bitwise xor will return:
1 2 3
0011
xor 1001
1010
Effectively when you xor two bits, the output is 1 if they are different and 0 if they are the same. When you use the ^ operator, you are xor'ing every bit in the numbers.
42 is 0010 1010
1 is 0000 0001
So in your equation 42 ^ 1 = 43
becomes
1 2 3
0010 1010
xor 0000 0001
0010 1011
0010 1011 is binary for 43
Note, the ^ operator is NOT the exponent operator.