The above UDF has been posted to the UDF forum. I also made a few small changes to it.
XOR()