This is pretty ugly. :) I realize your new to XSLT but it's obvious from the design of your stylesheet you don't quite have a grasp on what XSLT is and how it functions.
You're trying to select attributes from your source document. But all your data is in elements. You're apply-templates for no reason at all. You also have a one giant monolithic template that matches on the root that does does it all in one step.
You want to design with small nested templates and apply them to generate your output tree accordingly. I'll write up a good example in a little bit.
In the meantime, I'd suggest you learn about the basics. Even the W3C Schools walk through will teach you more than you understand now.