you don't need to change the structure of external.xml.
for the previously posted external.xml, following will be the solution
for this,
Let's say you have already got some value in a XSLT variable, x
(xsl:variable name="x" ...).
The XSLT code for this problem will be,
<xsl:variable name="external" select="document('external.xml')" />
<xsl:if test="$external/class/student = $x">
... do something
</xsl:if>
Cheers,
Mukul