Fixed XOR factory
Added XOR JUnit test cases