Your question isn't very good unfortunately. We have no idea what your XML looks like, and from a quick look your sample XSLT doesn't even look valid (you have two xsl:for-each instructions, but no closing tags for them).
Please read the 'hints for a good XSLT post' and then try again:
Hints for a good XSLT post