Will it work? Yes.
Should you use it? No.
This sort of micro-optimization would make sense if:
you have looked at the code the compiler generates for the straightforward way of doing this (assignment and a temporary) and decided that the XOR approach generates faster code
you have profiled your app, and found the cost of the straightforward approach outweighs the clarity of the code (and resulting savings in maintainability)
To the first point, unless you've done this measurement, you should be trusting the compiler. When the semantics of what you're trying to do are clear, there are a lot of tricks the compiler can do, including rearranging variable access so that the swap is not needed at all, or in-lining whatever machine level instructions provide the fastest swap for a given data type. "Tricks" such as the XOR swap make it harder for the compiler to see what you are trying to do, and thus make it less able to apply such optimizations.
To the second point, what are you gaining for the added complexity? Even if you've measured and found the XOR approach faster, is this having enough impact to justify a less clear approach? How do you know?
Finally, you should look into whether there is a standard swap function for your platform/language -- the C++ STL, for instance, provides a template swap function which will tend to be highly optimized for your compiler/platform.