Why use logic gates in this situation? (XOR gates)
One reason for using such a circuit is to avoid wire crossing. Integrated circuits are laid out on several planar layers, and inside each layer, wires are not allowed to cross (for obvious reasons). Hence if you want to switch two wires, you either need to reach out to a different layer, or to use a gadget such as the one shown. I have no idea whether this kind of gadget is actually used in practice.

It should be noted that same idea can be used to swap two values without using any additional memory:


$A \gets A \oplus B$
$B \gets B \oplus A$
$A \gets A \oplus B$


In a C-like language, this would be A ^= B; B ^= A; A ^= B. This code corresponds to an execution of your circuit in topological order.