title: Transforming an argument's contents with xslt
body: <p>I have an xml document with a structure roughly like:</p>
  
  <pre><code>&lt;report&gt;
       &lt;row&gt;
            &lt;field raw="&amp;lt;table&amp;gt; &amp;lt;tr&amp;gt; &amp;lt;td&amp;gt; R1C1 &amp;lt;/td&amp;gt; &amp;lt;td&amp;gt; R1C2 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;  &amp;lt;/table&amp;gt;" /&gt;
       &lt;/row&gt;
  &lt;/report&gt;
  </code></pre>
  
  <p>I can not directly change the xml document as far as I can tell, and can only update the raw attribute value.  I would like to transform that value the way I transform the xml contents itself, so that rather than showing the contents:</p>
  
  <pre><code>"&lt;table&gt;&lt;tr&gt;&lt;td&gt;R1C1&lt;/td&gt;&lt;td&gt;R1C2&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" 
  </code></pre>
  
  <p>I can instead match the transform the tags within the contents to generate the corresponding fo tags for PDF output, something akin to being able to set up a template to match it like:</p>
  
  <pre><code>&lt;xsl:template match="//report/row/field/attribute::raw/table/"&gt;
      &lt;fo:table&gt;
          &lt;xsl:for-each select="../tr"&gt;
              &lt;fo:table-row&gt;
                  &lt;xsl:for-each select="../td"&gt;
                      &lt;fo:table-cell&gt;
                          &lt;xsl:value select= "../" /&gt; 
                      &lt;/fo:table-cell&gt;
                  &lt;/xsl:for-each&gt;
              &lt;/fo:table-row&gt;    
          &lt;/xsl:for-each&gt;
      &lt;/fo:table&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>Obviously this does not work, as the contents of the attribute are not treated as xml nodes and the &lt; and > are escaped, so it  can't be matched in quite the same way. 
  Apologies if I am still misunderstanding some core concepts in my request, I'm still relatively new to xslt and xpath, so I'm not sure if I'm asking quite the right question.  I'm open to any different approach, though I'm trying to avoid parsing the string value directly.  I'll gladly provide clarification wherever needed.</p>