In the style sheet you can create the links in the output by using some thing like this:
- <xsl:attribute name="href">
<xsl:value-of select="WEB" />
Then if you have WEB tag in the xml file with a valid address, the link will be generated in the output.
As for the sorting, I'm not entirely sure I understand, or even no where to begin. But this example might help:
Best of luck,
Bireme, Pan American Health Org.