title: Copy any referenced figures to where they are referenced with xsl
body: <p>I am looking for a way to copy any referenced figure/node to where it is referenced.</p>
  
  <pre><code>&lt;chapter id="intro"&gt;
    &lt;title&gt;Introduction&lt;/title&gt;
    &lt;para&gt;Welcome to our new product. One of its 
    new features is a &lt;xref linkend="some-figure"/&gt;.  
    Other new features include ...
    &lt;/para&gt;
    &lt;para&gt;Grab that &lt;xref linkend="some-figure"/&gt; and pull it here too.&lt;/para&gt;
  &lt;/chapter&gt;
  &lt;chapter&gt;
    &lt;title&gt;Some other chapter&lt;/title&gt;
    &lt;para&gt;This chapter contains the figure!
     &lt;figure id="some-figure"&gt;&lt;title&gt;my figure...&lt;/title&gt;&lt;mediaobject&gt;...&lt;/mediaobject&gt;&lt;/figure&gt; 
    &lt;/para&gt;
  &lt;/chapter&gt;
  </code></pre>
  
  <p>Can this be turned into:</p>
  
  <pre><code>&lt;chapter id="intro"&gt;
    &lt;title&gt;Introduction&lt;/title&gt;
    &lt;para&gt;&lt;figure&gt;&lt;title&gt;my figure...&lt;/title&gt;&lt;mediaobject&gt;...&lt;/mediaobject&gt;&lt;/figure&gt;
    Welcome to our new product. One of its 
    new features is a &lt;xref linkend="some-figure"/&gt;.  
    Other new features include ...
    &lt;/para&gt;
    &lt;para&gt;&lt;figure&gt;&lt;title&gt;my figure...&lt;/title&gt;&lt;mediaobject&gt;...&lt;/mediaobject&gt;&lt;/figure&gt;
    Grab that &lt;xref linkend="some-figure"/&gt; and pull it here too.
    &lt;/para&gt;
  &lt;/chapter&gt;
  &lt;chapter&gt;
    &lt;title&gt;Some other chapter&lt;/title&gt;
    &lt;para&gt;This chapter contains the figure!
     &lt;figure id="some-figure"&gt;&lt;title&gt;my figure...&lt;/title&gt;&lt;mediaobject&gt;...&lt;/mediaobject&gt;&lt;/figure&gt; 
    &lt;/para&gt;
  &lt;/chapter&gt;
  </code></pre>
  
  <p>Updating the references to point to the copied figures would be icing on the cake, but I would like information regarding and way at all to get the nodes copied to where they are referenced.</p>