You ask a good question, and you'll get many variations of answers.
Here's my variation:
Personally, I choose the Springfield XD9 for these reasons:
1. Quality. Once you take apart both firearms and compare them to each other, it is obvious that the Springfield design has a little more thought put into it. The internals are slightly bulkier (which adds strength), and the internals are thought out well. The internals of the Glock brand are serviceable, and well thought out also, but they are a little "cheap" for a 600 dollar firearm (I have the same internals on my S&W Sigma .40, which is a 300 dollar firearm).
2. Barrel. I am not a big fan of polygonal barrels on anything other than surplus firearms (i.e. CZ-82 9x18mm). The polygonal design is a good way to save money during production, but I believe it draws the quality of the weapon down a touch.
3. Grip Angle. I am a big 1911 fan, and I love the grip angle of that weapon. Glocks just don't do it for me. The angle almost makes me have to make an effort to stay on target. The XD is much more natural in my hands. The change of angles between the two isn't a whole lot, but it's enough.
4. Grip Safety. Many people will argue that the grip safety is un-needed. Many of those same people will also make the statement "My trigger finger is my safety." I only ask two questions. How many times has a grip safety failed? How many times has the "trigger finger" safety failed?
5. Price. For the most part, the Springfield XD is going to be cheaper than a Glock 19. In this day and age, you cannot go wrong with purchasing a top motch firearm for less money. Take the money you save, and purchase some extra rounds to begin practice with.
Remember, these are just my opinions, and you know the saying "Opinions are like a**holes. Everyone has one."
Both sidearms will serve you well. Choose the one that best fits you, and take care of it well.