They're both great guns man..I have a Glock 27 the .40 love that. I've shot the Beretta and wish I can get that right now...I have a massive list of "wants" though. Both great guns...I think I'd go with the Beretta though.
I wanted a .45 hi-cap....I though either G21 or XD45... I have two Glock's and wanted something differece to give a shot. So went with the XD45
All up to you in the end. Head out to your local gun shop and feel them both. That usually settles it for me.