The XPath expression * selects all the element children of the context node. With a predicate, *[CONDITION] it selects all the element children where the CONDITION is true. If you use an expression like this in a boolean context (the test attribute of xsl:when) then the result is true if one or more nodes are selected, false if nothing is selected.
So:
test="*[substring(name(),2,2)='74']"
succeeds if there is at least one element child whose name has "74" in positions 2 and 3.
The expression:
*[$nodeFirstTwo='74']
is a bit peculiar because the condition $nodeFirstTwo='74' does not depend in any way on the node that you are applying it to - it will either be true for all children, or false for all of them. So this xsl:when succeeds provided that (a) there is at least one element child, and (b) the value of $nodeFirstTwo is equal to "74".
Now let's look at the variable declaration:
<xsl:variable name="nodeFirstTwo">
<xsl:value-of select="substring(name(*),2,2)" /> </xsl:variable>
Firstly, this is a very convoluted way of writing:
<xsl:variable name="nodeFirstTwo" select="substring(name(*),2,2)" />
What you want is a string, but instead of defining the variable as a string you are evaluating the string, putting the result into a text node, attaching that text node to a document node, and then computing the string value of the document node every time you reference the variable. If you don't care about performance and if you are bonused on the number of lines of code you write, this is fine, but otherwise it's horrible. Can't blame you though, it's an incredibly common blunder.
Next point. name(*). The name() function applies to a single node. In XSLT 1.0, if you give it a sequence containing several nodes, it will select the first one. In XSLT 2.0, this is an error. However, you're within match="/", so there will only be one element node, so this is OK. However, the net result is that
test="*[$nodeFirstTwo='74']"
is just a longwinded way of saying
test="$nodeFirstTwo='74'"
Now, the apply-templates
<xsl:when test="*[$nodeFirstTwo='74']>
<xsl:apply-templates select="*[substring(name(),2,2)='74']"/>
</xsl:when>
You've established in the xsl:when that the document element will have a name that matches [substring(name(),2,2)='74']. So giving the condition again in the apply-templates is completely redundant.
And then you test it a third time!
<xsl:template match="*[substring(name(),2,2)='74']">
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference