I own an M&P and a Glock 17 (close to the 19). Have shot about 100 rounds through an SR9 and would like to get one. Have never shot an XD or XDm - I have no doubt that they're good guns I just have no real desire to shoot one (don't like the grip safety).
From what I was able to tell form my shooting, the SR9 shot great.
In a couple of categories:
Ergonomics: The SR9 was about equal with the M&P. Both better than Glock here. Of note is that I have a Gen2 Glock. I like the models with the finger grooves even less.
Accuracy: All of them were capable of similar accuracy.
Reliability: Same - I had no issues with any of them.
Trigger: The Glock was a little better than the M&P or the SR9 out of the box, though none of them were so bad as to be unusable. Of note though is that the M&P has some great options for replacement triggers from Apex - which is what I run in mine and I now like it better than any of the others. My Glock runs a stock trigger but there are a lot of aftermarket options out there for it too. Not really a lot available for the SR9 there.
Sights: The SR9 had sights on par with the M&P. I didn't adjust them while I was shooting it but I'm almost positive the stock ones are adjustable, which is even better. M&P comes stock with taller sights that also aren't bad - particularly if you black out the dots. The Glock stock sights are atrocious. Plan on replacing them.
Random notes: The mag disconnect can be removed from the SR9 if you desire. No issue there. If you want a lot of mags, the Glock mags tend to be cheaper. $10-12 gets you aftermarket Korean mags and $20 will typically get you factory mags. M&P mags you can occasionally find as low as $25, but they're usually closer to $30, and SR9 mags are usually another $5-10 on top of that.
One thing that I DON'T like is that the SR9 isn't available in as many options. It comes in regular or compact. M&P comes in 3 different sizes (long slide, standard, and compact) and is also available with or without the safety and in a pro or standard version. Glock comes in enough flavors that you can almost always find what you want.
Other than that though, I view the SR9 as a pretty good gun. Buying one is on my "to do" list as funds allow
.