ESP = Electronic Stability Programme...only concerned with straightening up a car that's lost it's stability and is no longer on it's intended path.
It's a safety system, not a traction system.
XDS is a traction improvement...and does absolutely nothing to stop a car going sidewards when out of control.
They both use the ABS system for information though, and the ABS controller to activate the individual brake callipers.