As for whether it was a good deal XD vs. Glock I couldn't say without inspecting both guns but the G19 is a great pistol. I have a G23 which is the same size and pretty much perfect for most applications. It's hard to go wrong with the G19/G23.
As far as trading 40S&W for 9mm, that's your call. There are advantages to either caliber
As far as Gen 2, nothing wrong with that either. I have a G22 that's Gen 2 and no problems at all. You don't get a light rail and finger grooves but that's about it compared to later Gens.
The biggest issue with assembling an AR isn't so much getting the parts together right - it's getting the right parts together.
US Army 1966-69, VFW Life Member, Retired Geek