title: How to transform XML to match XSD or DTD?
body: <p>I have a Pentaho Kettle (PDI) transformation that starts with a Table Output step executing basic SQL. This step hops to an XML Output step that creates an XML file. </p>
  
  <p>The xml format looks like this:</p>
  
  <pre><code>&lt;series&gt;
   &lt;values&gt;&lt;Date&gt;2011&amp;#47;03&amp;#47;15 00:00:00.000&lt;/Date&gt; &lt;Media Cost&gt;$136.08&lt;/Media Cost&gt; &lt;Clicks&gt; 50.0&lt;/Clicks&gt; &lt;/values&gt;
   &lt;values&gt;&lt;Date&gt;2011&amp;#47;03&amp;#47;16 00:00:00.000&lt;/Date&gt; &lt;Media Cost&gt;$240.47&lt;/Media Cost&gt; &lt;Clicks&gt; 71.0&lt;/Clicks&gt; &lt;/values&gt;
  </code></pre>
  
  <p>However, I need this XML to be a specific format. I do have an XML schema and DTD to define this format, just not sure the best way to get into that format.</p>
  
  <p>Here is an example of how it needs to be formatted. </p>
  
  <pre><code>&lt;series name="Media Cost"&gt;
  &lt;value&gt;340&lt;/value&gt;
  &lt;value&gt;154&lt;/value&gt;
  &lt;value&gt;516&lt;/value&gt;
  &lt;value&gt;103&lt;/value&gt;
  &lt;value&gt;315&lt;/value&gt;
  &lt;/series&gt;
  
  &lt;series name="Clicks"&gt;
  &lt;value&gt;476&lt;/value&gt;
  &lt;value&gt;504&lt;/value&gt;
  &lt;value&gt;239&lt;/value&gt;
  &lt;value&gt;111&lt;/value&gt;
  &lt;value&gt;224&lt;/value&gt;
  &lt;/series&gt;
  </code></pre>
  
  <p>Any advice is appreciated. </p>