Ah, we are a biased bunch here, I'm afraid! It is tough for a relative newcomer to ask "which is better" questions, becuase we ALL have opinions, and some of them are really strong.
The glock is (reportedly) a fine firearm. Just watch out for the plastic sights, which will probably need to be replaced if you are holstering your pistol. Also, some find the grip angle really frickin' weird. The trigger is also a bit on the... plasticky side. But, they are really popular, inexpensive, and easy to find parts for. That said, the only firearm I have ever personally witnessed fall apart was a brand new Glock 17, with factory 9mm ammo. (In about 21 years of shooting).
So, yeah, the Glocks are great! (Supposedly). But, I don't like 'em!
My wife bought an XD9, and it is great, except for trying to find a level 2 holster for it!
I believe Slavex here on the board REALLY does not like the XD, from his personal experiences.
Buy what fits you best, and IF AT ALL POSSIBLE, test fire both before you buy.
Good luck with your quest!
Neal