Hi Frank
I think you can get what you want with a series of xsl:if elements.
If I were you I might extract all the LoanTransactionDetails things into its own template. Like this:
<xsl:apply-templates select="LoanTransactionDetails"/><br>
And then the template might be like this:
<xsl:template match="LoanTransactionDetails"> <soap:LoanTransactionDetails> <xsl:if test="procFile != ''"> <soap:procFile><xsl:value-of select="procFile"/></soap:procFile> </xsl:if> ... </soap:LoanTransactionDetails> </xsl:template>
In my experience, XSL can be a challenge. You might want to try an interactive editor, like this one: https://xslttest.appspot.com/
(No affiliation)