Dynamical quantum phase transition in the XY model