<xsl:for-each select="Kafedra"> .... <xsl:for-each select="../Prepodavateli[id_kaf=current()/id_kaf]">