Had both....the M&P wins hands down.
I've had every 'tupperware' pistol known to man, and the M&P is the best one...(in 40 S&W that is!)
In 9MM or 45ACP, it may be a toss up.
I have, and love, my Glocks....9MM (G19/17) as well as a 45ACP (G21)...
BUT, having put a few rounds downrange with my M&P (40S&W), I also would be tempted to pick up one up in 9MM as well.
As with all of these threads, it's all down to personal preference...grips/sights/trigger, etc.
I had an XD9 and didn't have any real issues with it, but hated the grip safety.
If you haven't had an M&P I would recommend it highly...if it doesn't 'float your boat', you can always put it up on the EE!