I own 3 of the xd's 2 9mm and 1 .45. I actually traded an m&p9 for the. 45acp, the guy bought it and did like how much ammo cost!! Lucky for me! I did not like the m&p. It just didn't work for me. I think I came out on the top of that trade.
As far as the 2 are compared u could not go wrong with either 1. Will come down to personal preference. In my are the xd is a tad bit cheaper as well