Java/JSP can do this VERY easily using the built-in Document Object Model, especially the latter if you have Tomcat or another JSP app server running on your webserver.
Check this out. Chapter 8 is about the DOM. You can write a fairly simple JSP page that will traverse through your whole site, link by link, and catalogue where each page goes, etc. That is, if I understand what you're asking...