title: Select text from child node and omit text node
body: <p>I'm basically looking for the opposite of <a href="https://stackoverflow.com/questions/5182249/select-text-from-a-node-and-omit-child-nodes">this</a></p>
  
  <p>An example of the XML I'm dealing with:</p>
  
  <pre><code>&lt;profiledesc&gt;
     &lt;creation&gt;
         Finding Aid encoded by Some Guy, &lt;date normal="2011-09-21"&gt;21 September 2011&lt;/date&gt;
     &lt;/creation&gt;
     &lt;langusage encodinganalog="546"&gt;
        Finding aid written in
        &lt;language langcode="eng" scriptcode="latn" encodinganalog="041"&gt;
           English   
        &lt;/language&gt;
     &lt;/langusage&gt;
  &lt;/profiledesc&gt;
  </code></pre>
  
  <p>An example of the XSLT I'm writting (only the relevant parts):</p>
  
  <pre><code>&lt;xsl:template priority="3" match="descgrp|eadheader|filedesc|titlestmt|profiledesc|archdesc|langusage|did"&gt;
     &lt;xsl:apply-templates select="./child::node()"/&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template priority="2" match="language"&gt;
     &lt;atom name="EADLanguageOfFindingAid" type="text" size="short"&gt;
        &lt;xsl:value-of select="."/&gt;
     &lt;/atom&gt;
     &lt;atom name="EADLanguageCodeOfFindingAid" type="text" size="short"&gt;
         &lt;xsl:value-of select="normalize-space(@langcode)"/&gt;
     &lt;/atom&gt;
  &lt;/xsl:template&gt;
  
  ... Other templates, for nodes like 'creation' ....
  </code></pre>
  
  <p>An example of the (bad) output I'm getting:</p>
  
  <pre><code>... Some other tags ...
  &lt;atom name="EADCreation" type="text" size="short"&gt;Finding Aid encoded by Some Guy, 21 September 2011&lt;/atom&gt;
  Finding aid written in
  &lt;atom name="EADLanguageOfFindingAid" type="text" size="short"&gt; English &lt;/atom&gt;
  &lt;atom name="EADLanguageCodeOfFindingAid" type="text" size="short"&gt;eng&lt;/atom&gt;
  ... Some other tags ...
  </code></pre>
  
  <p>An example of the (good) output I <strong>want</strong>:</p>
  
  <pre><code>... Some other tags ...
  &lt;atom name="EADCreation" type="text" size="short"&gt;Finding Aid encoded by Some Guy, 21 September 2011&lt;/atom&gt;
  &lt;atom name="EADLanguageOfFindingAid" type="text" size="short"&gt; English &lt;/atom&gt;
  &lt;atom name="EADLanguageCodeOfFindingAid" type="text" size="short"&gt;eng&lt;/atom&gt;
  ... Some other tags ...
  </code></pre>
  
  <p><strong>Note that in the second output the "Finding aid written in" line is missing</strong>.</p>
  
  <p>So, as you can see, I designed templates to output <em>just</em> the "language" portion of the "langusage" tag, but the whole tag, including the "Finding aid written in" text node, is being output instead. I can't be sure that the text node will exist or that it will be first (or last, or in any particular position). I also can't be sure that there will only be one text node or one child node. So, I can't make use of any solution that relies on simply choosing the "[xth]" node (child or text).</p>
  
  <p>I'd appreciate any advice at this point, even some keywords that would help me find the solution via Google (I've had no luck there so far).</p>