You have the right idea, you need to get the right select line.
But, unless you really need XSLT -- and for a one-time translation, you really don't -- using any real programming language you're familiar with is going to be faster and easier.
I've done a bit of XSLT stuff, but I've only managed by using the simplest of select lines.
Oh, and when I used XSLT? I needed to preprocess it to get it how I wanted.