Transforming xml from sql
I have a stored procedure in SQL that ends with an XML AUTO.
I'm having trouble understanding all the xml-related objects and what exactly I need to do to run the stored procedure with a parameter, put that xml through an xslt stylesheet and save the result to a file.
After much searching I've found the answer to each part, but I'm having trouble getting it to all come together.

Answers
Know the answer? Post it. Somebody with the same question will find it here.