How to swap 2 integers without temp variable using XOR

using System;

public static class SwapTwoIntegers
{
    private static void Main()
    {
        var a = 55;
        var b = 69;

        SwapInts(ref a, ref b);

        Console.WriteLine(a); // 69
        Console.WriteLine(b); // 55
    }

    private static void SwapInts(ref int a, ref int b)
    {
        a ^= b;
        b ^= a;
        a ^= b;
    }
}