<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:dp="http://www.datapower.com/extensions"
  extension-element-prefixes="dp"
>
  <dp:input-mapping  href="store:///pkcs7-convert-input.ffd" type="ffd"/>
  <dp:output-mapping href="store:///pkcs7-convert-input.ffd" type="ffd"/>

  <xsl:variable name="remove" select="8"/>

  <xsl:template match="/">
    <xsl:variable name="input64"
       select="dp:binary-encode(/object/message/node())"/>

    <object>
      <message>
        <xsl:copy-of 
          select="dp:binary-decode(dp:substring-base64($input64, $remove+1))"/>
      </message>
    </object>

  </xsl:template>
  
</xsl:stylesheet>