title: Converting Linq to XSLT
body: <p>Is there a way to convert LINQ queries into XSLT? the same way LINQ can be converted to SQL?</p>
  
  <p>I mean if i have a solid well defined XML(Conforms to an XSD) is there a way to compile the stuff under System.Linq.Expressions into XSLT in regard to that XML?</p>
  
  <p>Thank you.</p>
  
  <p>To Dimitries request I'll try to elaborate a little...  Basically I have some data in one place (it's basically to chunks of xml serializable data), and I need to process them, I need to combine and process them.</p>
  
  <p>Both the incoming original data , and the output result data, are XML serializable, and conform to a well defined XSD.</p>
  
  <p>I want to generate the processing logic dynamically - someplace else. And allow my user to change and play around with the processing. I can represent the processing it self easily with Expression trees. Expression trees are similar to parse trees and can capture program code. This is the way linq to SQL works it converts expression trees to SQL queries.</p>
  
  <p>Since all the income data and the output are both a well defined XML I can do the transformation easily with XSLT, but I'm not familiar with XSLT enough to write a dynamic XSLT generator. So I thought I could build the transformations in C# and convert them into XSLT.... again its not general purpose C#, but probably specific queries over a well defined data provider.</p>
  
  <p>For the example sake:</p>
  
  <p>(Not real code)</p>
  
  <pre><code>var schemas = XSchemaSet.Load("a","b");
  var doc = XDocument.Load("File",schemas);
  
  var result = from node in doc.Nodes
               where node.Name == "Cats" || node.Name == "Dogs"
               select (new Node(){Name = "Animal Owner", Value = node.Owner)
  var newDoc = new XDocument().AddNodes(result);
  newDoc.Validate(schemas);
  </code></pre>
  
  <p>Basically I want something that will function like that... I can write that in a single linq query if I use <code>IQueryable.Aggregate</code></p>