iirc , basic XOR means replacing 0 with 1 and vice versa ie 1011 => 0100.
To unencrypt, apply the same rule to the result above...
This is a symmetric encryption/decryption method.
For a good explanation of symmetric and asymmetric encryption, see the manual here: http://www.gnupg.org/
Also has code for you to use.