title: XML to XSL-FO C#.NET
body: <p>How can I convert/transform/create an xsl-fo file from an XML document using an xsl stylesheet i C#.NET?</p>
  
  <p>What I want to achieve is a REST Service that is used to "print" a PDF to the browser. The XML is loaded in via another REST Service and the stylesheet is pre-defined and located in my project as a resource.</p>
  
  <p>This is the code so far, just to demonstrate the structure I'm after: (Note that the return type String is just for troubleshooting and will be replaced once I get further)</p>
  
  <pre><code>    public String GetPDFList(String apiquery, String template)
      {
          String returnString;
  
          /* BUILD QUERY TO GET XML CONTENT */
          string returnUrl = api_url + apiquery + api_key;
  
          /* BUILD XML CONTENT TO DOCUMENT */
          XmlDocument doc = new XmlDocument();
          doc.Load(returnUrl);
  
          /* GENERATE XSL-FO FILE FROM XML AND XSL STYLESHEET */
          /* TODO */
  
          /* GENERATE PDF FROM XSL-FO FILE */
          /* TODO */
  
          /* RETURN PDF TO CLIENT */
          /* TODO */
  
          return returnUrl; 
      }
  </code></pre>
  
  <p>EDIT: I'm currently trying to achieve this using the fo.net library but I can't find any documentation on how to perform this single task of creating the xsl-fo file.</p>