XOR encryption is considered the only mathematical proven way of non breakable encryption. It only works, if the key used for encryption is as long as the encrypted message and is being used only once. The key has to contain only hard random numbers.
This way of keeping secrets is called the one time pad.
If you fail to obey the rules above, the encryption is not safe anymore, since the standar cryptoanalytical methods can be applied to the encrypted text.
The soviets for instance used the one time pads after the WWII for the communication with their agents in the USA. They generated their random numbers by letting someone type at a typewriter at random. The persons who did this used onle one hand, hence typing only on the left or the right sides of the typewriter' keyboard. This little hook was enough to crack the cipher.