OK here are some inputs and outputs expected. I hope this will help?
INPUTS
This will be from the sitemap xml but assume the input for one level will be:
Code:
<sitemap>
<navlink>
<description>some link one</description>
<linktarget>http//www.linkone.com</linktarget>
</navlink>
<navlink>
<description>some link two</description>
<linktarget>http//www.linkone.com</linktarget>
</navlink>
<navlink>
<description>some link three</description>
<linktarget>http//www.linkone.com</linktarget>
</navlink>
</sitemap>
OUTPUT
The output will simply just show the <description> as a hyperlink to <linktarget>.
I would like to loop through the sitemap xml and check the current page is the same as (x) in the sitemap loop. If it is the same, check to see if (x) is not the last link. If it is not, then display the next description and linktarget as the hyperlink. If it is the last link, simply do nothing or just output some generic text such as "last".
Does this help?
Trying to explain best I can.