First, let me say that i have owned 2 of each:
4" XD40 w/ heinie sights
4" XD45
G19 9mm
G27 40cal (i carry it currently)
and i have shot the XD subcompact 9 as well.
In the past year i have picked up shooting as a hobby and I absolutely love handguns. I have owned quite a few, and I am no expert but i have some experience with both brands.
I feel that both have their positives and negatives. Both are made with extremely good quality and I have had no failures or problems with either brand. In my opinion, the XD is a better gun IF shooting is your main concern. While the Glock does have a lower profile and an overall smaller size( when comparing a G27 to a subcompact XD), the XD shoots better plain and simple. I dont know anybody that can make an argument that the Glock feels better and shoots better, because it doesnt. The springfield is MUCH more ergonomic, MUCH more comfortable/pointable, and in turn, MUCH more accurate when shooting. I actually just got done shooting 200 rounds through my G27 yesterday. I chose to buy it for carry because it seemed ideal. It is overall much smaller and less bulky than the springfield, but I feel as if i made a poor decision in buying it as my carry gun after shooting 200 rounds through it at the range yesterday. Although my G19 has a smooth-style trigger and a 3.5lbs trigger connector, the trigger pull of the glock is nowhere near as natural feeling and comfortable as the XD. The trigger on the Glock is very angled and my finger feels as if it is slipping all over when i pull it. The XD is solid. My finger just sticks right on it and comes straight back. After 200 rounds through my G27 my trigger finger was in alot of pain because of the crappy feel it has upon recoil. I could shoot 1000 in a row with my XD and my whole hand would still be just fine. The size of the Glock's grip is too wide(from front to back) and I dont like the knuckle groves. They also cause some pain when shooting(and i dont have big hands at all).
I could go on and on, but to put it simply i think the Springfield is just a better gun overall. I carry the G27, but i will soon be trading it in for a SIG p239 SAS. I am also getting rid of my Glock 19 as well.. theres just nothing that this brand of gun offers except its reliability(but i would say no more reliable than most other high-end guns) and the external simplicity and sleekness of the slide. Other than that, it really isnt too comfortable to shoot, it hurts my hand, it doesnt have any other features to it, and I can't shoot it well. I think if I had to choose only one gun to serve as my over-all piece, I would take the XD over the Glock in a heartbeat. The ONLY area the Glock has the XD beat in is the size of the slide. The XD has a much bulkier and taller slide, but the rest of the gun makes up for it. XD > Glock overall is my say.....
edit* forgot to mention the obvious... the XD also takes the Glock in features. Some(including myself) look for simplicity, but the features of the XD such as the loaded chamber idicator, cocked firing pin indicator, gip safety, metal guide ride vs. plastic, etc etc. just give you more for your money. Some of those things arent needed in a carry gun, so a sub-compact glock might be more desirable for carry vs. an xd SC, but after shooting both one would have to be crazy or have deformed hands to think that the Glock would give them an advantage over the XD in a real gunfight. We are all human and the XD was better designed to fit human hands than the Glock... and that's what counts when actually trying to hit your target: feel, comfort, pointability, and shot recovery. XD wins this category.