Go try both and see how they fit you as that is more important than anything else. I chose the XD in 4in because that is what fit be better than the Glock. However, in the subcompact pistols I find the XD to be to block shaped and uncomfortabe in my hand and prefer the Glock.
I bought an XD9sc a couple days ago. Finally got to the range today and it was flawless. I even shoot better with it than I do the Bersa 9, for some reason.
The grip feels a bit smaller around than the G26 to me, which is why I went with the XD. Well that, and the fact I love the way BiTone model looks