Using this Simulation you can get an complete idea about XOR logic gate.
If you consider the process happening here is,
X = 0 and Y = 0 Result = 0
X = 0 and Y = 1 Result = 1
X = 1 and Y = 0 Result = 1
X = 1 and Y = 1 Result = 0