I'm not sure what your problem exactly is,
From your question I see you recognized how to come from 3D- XYZ Space to xy(Y) space.
Here you will find a set of formulas from convert from Spectrum to XYZ on from there to xyY, sRGB, etc. and vice versa (of course excl. 3D back to spectrum):
Here a good article on CP with also a lot of background info:
Color Topics for Programmers
I hope it helps.
Explaining how to calculate(show) the "horse Shoe" in the xy- plane is too much to explain it here ;)