title: Using ruby/nokogiri to transform xml to another xml
body: <p>I've never encountered task of transforming XML from one form to another. I hear that XSLT is just for that, but I don't want to go there. So, using only ruby and nokogiri, how can I:<br>
  <strong>remove</strong> all <em>item</em> <strong>elements</strong> but <em>time</em> from initial XML and also <strong>rename element</strong> <em>time</em> to <em>HammerTime</em>?<br>
  Initial XML:  </p>
  
  <pre><code>...
  &lt;item&gt;
    &lt;time&gt;05.04.2011 9:53:23&lt;/time&gt;
    &lt;iddqd&gt;42&lt;/iddqd&gt;
    &lt;idkfa&gt;woot&lt;/idkfa&gt;
  &lt;/item&gt;
  &lt;item&gt;
  ...
  </code></pre>
  
  <p>Desired result:</p>
  
  <pre><code>...
  &lt;item&gt;
    &lt;HammerTime&gt;05.04.2011 9:53:23&lt;/HammerTime&gt;
  &lt;/item&gt;
  &lt;item&gt;
  ...
  </code></pre>
  
  <p>I figured out how to put data from XML to array using nokogiri's .xpath, but is there a way to make the desired transformation into another XML without manually having to write something like <code>puts "&lt;HammerTime&gt;#{array['time']}&lt;/HammerTime&gt;"</code>?</p>