I can't speak for the XDM40 specifically, but I love my 4" XD45 Compact. Accurate and comfortable to shoot. I shoot better with my XD than I do with my father's Glock 19. Whenever he's fired my XD, he's seemed impressed. I've also heard great things about the M&P. I would suggest, if possible, you try to hold each type before deciding. I think it often really comes down to your preference on how the pistol fits in your hand/grip style. I've never had any reliability troubles with my XD and it is very similar to Glock in many ways. I prefer the field stripping of the XD over a Glock, but that's mostly because I have trouble grasping the takedown tabs on the Glock (the rotating lever on my XD is easily moved with one thumb). If you're happy with your Glock, the XD will feel familiar and perhaps the grip will suit you better as it does for me. Good luck and given your choices, you probably can't go wrong.