Given a source XML document and a sample of what it should look like after it is transformed, is there a code generator that could create an XSL transform to accomplish that.
I am not expecting it to be perfect but, much like the code generators that can create XSD from sample XML, it would be a good starting point to then refine by hand.
XSLTGen looks promising and exactly what you're looking for.
Update: (4-Apr-2015)
Updated the link to the correct link as pointed to by: @user326608
What you're asking is, essentially, "Given a set of input data and an output, is it possible to infer the logic of a program that will produce that output?" Except for the trivial case - where the program produces the provided output irrespective of the input - the answer is "No."
try ALTOVA MapForce (http://www.altova.com/mapforce.html)