You should probably take your XF to the dealer for some updates to the computer settings.

Changing the diameter of the wheel effectively changes the gearing of the car (since the wheels turn at a different velocity) and will throw off the computers' readings for speed and shift points. Your issues in the rain are likely caused from issues in the differential and maybe the traction control system trying to manage 19 inch wheels using 17 inch wheel calculations. Sometimes you can get away with going up or down an inch in diameter, but two inches creates almost 12% error in the computers' logic.