There is no such thing as XSLT 1.2 - I assume you mean XSLT 2.0.
And no, knowing it is 834 X12 file doesn't help at all unsurprisingly.
You can count nodes based on some form of criteria, the exact same criteria that you are using to determine if a node should be output.
e.g. count(/root/node[value='output'])
Alternatively you will have to create your output in a temporary variable (this is easier in XSLT 2.0) and then count how many nodes are in it before outputting the variable, e.g.
Code:
<xsl:variable name="output">
<xsl:apply-templates select="nodes"/>
</xsl:variable>
<xsl:variable name="outputCount" select="count($output/nodes)"/>
<xsl:value-of select="$output"/>
<xsl:valur-of select="$outputCount"/>