title: How to extract attachments from xml including name and size?
body: <p>I have the following data in an XML file </p>
  
  <pre><code>&lt;attachment name="data.pdf" size="104302"&gt;
  DATA
  &lt;/attachment&gt;
  </code></pre>
  
  <p>I would like to extract the full thing into a new xml but I am only getting </p>
  
  <pre><code>&lt;attachment&gt;
  DATA
  &lt;/attachment&gt;
  </code></pre>
  
  <p>My xslt file has</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:output method="xml" encoding="utf-8" indent="yes"/&gt;
  &lt;xsl:strip-space elements="*"/&gt;
    &lt;xsl:template match="/"&gt;
      &lt;xsl:for-each select="//attachment" &gt;
        &lt;xsl:copy&gt;
              &lt;xsl:apply-templates select="node()" /&gt;
        &lt;/xsl:copy&gt;
      &lt;/xsl:for-each&gt;
    &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Any help is greatly appreciated!</p>