Creating tag QNames from element text
<p>I have two questions connected with transformation XML to XML. </p>

<ol>
<li><p>How make a new element which name is value of existing element (in my example the value of existing element <code>&lt;author&gt;</code> is Mike and I want to make a new tag named Mike).</p></li>
<li><p>How make a new element which attribute name is value of existing element (in my example the value of existing element <code>&lt;grade&gt;</code> is 5 and I want to make a new tag named Mike with attribute name "5"). Here is my example:</p></li>
</ol>

<p>Existing XML:</p>

<pre><code>&lt;art&gt;
  &lt;images&gt;
    &lt;image&gt;
      &lt;title&gt;Cat&lt;/title&gt;
      &lt;author&gt;Mike&lt;/author&gt;
      &lt;grade&gt;5&lt;grade&gt;
    &lt;/image&gt;
    &lt;image&gt;
      &lt;title&gt;Snake&lt;/title&gt;
      &lt;author&gt;John&lt;/author&gt;
      &lt;grade&gt;4&lt;grade&gt;
    &lt;/image&gt;
  &lt;/images&gt;
&lt;/art&gt;
</code></pre>

<p>New element inside tag art:</p>

<pre><code>&lt;authors&gt;
  &lt;Mike grade="5"&gt;
    &lt;field_of_art&gt;photography&lt;/field_of_art&gt;
  &lt;/Mike&gt;
&lt;/authors&gt;
</code></pre>