title: How can I strip text from XML elements, rearrange it, and concatenate it with XSLT?
body: <p><br />
  Considering the following XML:
  <br /></p>
  
  <pre><code>&lt;root&gt;
    &lt;contrib contrib-type="author"&gt;
      &lt;name&gt;
        &lt;last-name&gt;Simpson&lt;/last-name&gt;
        &lt;first-name&gt;Bart&lt;/first-name&gt;
      &lt;/name&gt;
    &lt;/contrib&gt;
  
    &lt;contrib contrib-type="author"&gt;
      &lt;name&gt;
        &lt;last-name&gt;Zoidberg&lt;/last-name&gt;
        &lt;first-name&gt;Dr.&lt;/first-name&gt;
      &lt;/name&gt;
    &lt;/contrib&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>...how can I transform the contents of these elements to get this output?
  <br /></p>
  
  <pre><code>&lt;Authors contrib-type="author"&gt;Bart Simpson&lt;/Authors&gt;
  &lt;Authors contrib-type="author"&gt;Dr. Zoidberg&lt;/Authors&gt;
  </code></pre>
  
  <p><br /><hr /><br />
  I am trying to concatenate the contents of &nbsp;<code>&lt;first-name&gt;</code>&nbsp; with the contents of &nbsp;<code>&lt;last-name&gt;</code>&nbsp;, and <strong>separated by a single space</strong>.
  <br /><br />
  Also, there is no need for any sub-elements of &nbsp;<code>Authors</code>&nbsp;(getting rid of the &nbsp;<code>&lt;name&gt;</code>&nbsp;, &nbsp;<code>&lt;first-name&gt;</code>&nbsp;, and &nbsp;<code>&lt;last-name&gt;</code>&nbsp; elements if possible).
  <br /><br /><hr /><br />
  This is the XSL I have so far (<em>which is not working</em>):
  <br /></p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:output omit-xml-declaration="yes" indent="yes" method="xml"/&gt;
  &lt;xsl:strip-space elements="*"/&gt;
  
      &lt;!-- identity rule --&gt;
      &lt;xsl:template match="node()|@*"&gt;
          &lt;xsl:copy&gt;
              &lt;xsl:apply-templates select="node()|@*"/&gt;
          &lt;/xsl:copy&gt;
      &lt;/xsl:template&gt;
  
          &lt;!-- Authors --&gt;
          &lt;xsl:template match="contrib[@contrib-type='author']"&gt;
              &lt;Authors&gt;
                  &lt;xsl:apply-templates select="@*|node()"/&gt;
                  &lt;xsl:value-of select = "concat(given-names, surname)" /&gt;
              &lt;/Authors&gt;
          &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p><br />
  So far, I am able to transform the &nbsp;<code>&lt;contrib&gt;</code>&nbsp; element to &nbsp;<code>&lt;Authors&gt;</code>&nbsp;, but am not able to concatenate or strip its' sub-elements...
  <br /><br /></p>