I have shot both extensively. Close friends and range pals own each.
Both are quality in terms of reliability and durability. Both have run flawlessly.
In terms of shootability and handling of the .40, the M&P 40 wins, and in my opinion it's not even close. Not intended as an insult to XD-40 fans - it IS a good gun - but the M&P feels very smartly designed around the .40. As I mentioned in another thread re: the M&P, I think it, the Beretta PX4, and the Sig 229 are kings of the hill in terms of how they handle .40. All three of those platforms confidently own the cartridge.
14 Pistols, 5 Rifles, 1 Shotgun, no time to shoot them