<p>I have an XML document with several <code>&lt;person&gt;</code> elements, each of which contains the <code>&lt;name&gt;</code> of the person, and several <code>&lt;preferred-number&gt;</code> elements inside a grouping <code>&lt;preferred-numbers&gt;</code> element. </p>

<p>I already found that to obtain the greatest <code>&lt;preferred-number&gt;</code> I have to do an <code>&lt;xsl:apply-template&gt;</code> with a <code>&lt;xsl:sort&gt;</code> inside it and then take the first element, as XSLT v1.0 doesn't have <code>fn:max()</code>. </p>

<p>But I guess that this would give me the greatest value from all. So, how could I arrange a stylesheet to extract each person's <code>&lt;name&gt;</code> with their greatest <code>&lt;preferred-number&gt;</code>?</p>

When it comes to sorting stuff in XSLT 1.0 you have to use a slightly roundabout approach as I recall. If you haven't already you'll want to look into
Muenchian grouping
to give you some ideas to start with.
I've found
this site
to be a very useful resource.