The XY model coupled to two-dimensional quantum gravity