You shouldn't be loading the documents multiple times like that. You should load the document once into a variable and then reuse it.
Code:
<xsl:variable name="employees" select="document('employee.xml')"/>
<xsl:variable name="empIds" select="document('emp.xml')"/>
Also, you can use a key to find information in one file based on the information in another file.
Code:
<xsl:key name="empKey" match="employee" use="empid"/>
Then, loop through each ID in your second document, and look the employee record up in the first document. Note - inside the xsl:for-each the context becomes the node you have selected. There is no need to refer to the $empIds variable again (in fact this will give you incorrect results).
Code:
<xsl:for-each select="$empIds/employee/employeeinf/empid">
<xsl:variable name="employee" select="key('empKey', .)"/>
ID = <xsl:value-of select="$employee/empid"/>
Name = <xsl:value-of select="$employee/empname"/>
</xsl:for-each>