Ok, So I used SEPATruncage tags for post processing (André really helped me out here!). . Envelope was indeed removed and the error on the envelope was resolved.
Now the story continues. The bank does not accept "Byte Order Marks". So I need to truncate BOM as well. So I searched for a way to truncate BOM. I managed to extract SEPATruncateTagsAndBOM.xsl from a hotfix for Italy and Finland. SO I used this one to post-process the XML file. Unfortunately, still Byte order marks in the file.
The contents of TruncateTags.xsl:
[quote]
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="www.w3.org/.../Transform" xmlns:wt="schemas.microsoft.com/.../Message" version="1.0">
<!--Copy all nodes from source-->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<!--Remove header, message parts, body and envelope tags-->
<xsl:template match="wt:Envelope/wt:Header">
</xsl:template>
<xsl:template match="wt:Envelope/wt:Body/wt:MessageParts">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="wt:Envelope/wt:Body">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="wt:Envelope">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
[/quote]
The content of SEPATruncateTagsAndBOM.xsl:
[quote]
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="www.w3.org/.../Transform"
xmlns:wt="schemas.microsoft.com/.../Message"
xmlns:s1="schemas.microsoft.com/.../VendPayments"
version="1.0">
<xsl:output method="xml" encoding="iso-8859-1" />
<!--Copy all nodes from source-->
<xsl:template match="/">
<xsl:text disable-output-escaping="yes"><?xml version="1.0" encoding="utf-8"?></xsl:text>
<xsl:copy-of select="wt:Envelope/wt:Body/wt:MessageParts/*" />
</xsl:template>
</xsl:stylesheet>
[/quote]
Maybe I can make a custom XSL ? If I get rid of the Byte Order Marks our bank is happy, and so am I :)
Kind regards, Willem.