title: How to generate XML file using Ruby and Builder::XMLMarkup templates?
body: <p>As you all know, with Rails it is possible to use Builder::XMLMarkup templates to provide an http reponse in XML format instead of HTML (with the respond_to command). My problem is that I would like to use the Builder::XMLMarkup templating system not with Rails but with Ruby only (i.e. a standalone program that generates/outputs an XML file from an XML template). The question is then twofold:</p>
  
  <ol>
  <li>How do I tell the Ruby program which is the template I want to use? and</li>
  <li>How do I tell the Builder class which is the output XML file ?</li>
  </ol>
  
  <p>There is already a similar answer to that in Stackoverflow (<a href="https://stackoverflow.com/questions/2176287/how-do-i-generate-xml-from-xmlbuilder-using-a-xml-builder-file">How do I generate XML from XMLBuilder using a .xml.builder file?</a>), but I am afraid it is only valid for Rails.</p>