There's a more general formulation, which is that every value but one must appear even numbers of times, and the one must appear some odd number of times.
Solution: xor is just addition mod 2. Write the numbers in base n and do digit-wise addition mod n (ie without carry). Very intuitive way to see the xor trick.