Given an XML structured as

dog @id

Where the father and the mother are identified by @id, and are of course peer nodes. I need to print out the name instead of the id in XSLT inside a for-each loop.

What is the Best Practice way to do this?

Thank you!

My apologies, the editor stripped my indentation...

More specifically, here is the XML, and notice that the <mate> and <offspring> are identified by an id (string) that correlates to the @id of another <monkey>:

	<monkey id="m001">

Now, here is the XSLT, and what I want to do is replace the <mate> string (which is the @id of another <monkey>) to the <name> associated with it:

<!--  MATE COLUMN </!--> 
					<xsl:variable name="mateid">
						<xsl:value-of select="*/mate"/>
						<xsl:when test="*/mate">
							<td><xsl:value-of select="$mateid"/></td>