As others have already stated, it comes down to what is best for you. I will, however, give a nod to the XD. I own or have owned Glocks, an M&P .45, and an XD .45 compact. Straight out of the box, I shot the M&P the best, but had several failures to return to battery using different ammo, shooters, and with different round counts in the mag. I traded it in on the XD, and after getting aquainted with each other, I don't regret it one bit. As for the Glocks, they are great guns (always go boom), I just don't shoot them as well. I guess it's the grip angle, but I personally will avoid them unless they're going to be used within combat distances.
Swoop