Try:
<xsl:if test="TimestampChange[@Op='E'] and count(*[@Op]) = 1">True</xsl:if>
EDIT: Based on your updated question and comment, I'm guessing that you want the following:
- If
CompDate[@Op]
is either "E" or "A", then the statement is true if and only if TimestampChange
has no Op
attribute, regardless of whether or not the other nodes have an Op
attribute; - Otherwise, the statement is true if any only if
TimestampChange
is the only node with an Op
attribute;
<xsl:if test="((CompDate[@Op='E'] or CompDate[@Op='A']) and TimestampChange and count(TimestampChange[@Op])=0) or (TimestampChange[@Op] and count(*[@Op])=1)" >True</xsl:if>