Sounds bad! But did the XF drive away in the 5th without stalling the engine? Cool! Sorry, in consideration of your problem.
Looks like the shift control is not working properly. Might be because of fault Autostick mode. When the transmission locked in a low gear, did the indicator still show "D" or only "1" or "2"?