For a while now, I've been doing projects publishing content that is arranged in a natural heirarchal order, but where the links within the content can come from both the structure as well as arbitary links provided by the author.
I have come up with various schemes in the past involving related databases and the like, I have got pretty sick of them and had material I wanted to re-work.
I currently work in and XSL so I started developing an XML based solution to the problem, using XML standards XLink and XInclude, because as I am using Cocoon as my publishing engine, I don't have to wait for browser manufacturers to catch up and implement the standards (differently from each other).
By using Cocoon, I can take advantage of those standards straight away for my publishing application, because I can use XSLT to transform the content for the web browser, PDF reader, QuickTime Plugin etc., translating processed XLinks into HTML Anchors for instance. Cocoon allows me to output the same XML to different formats by just supplying new XSLT StyleSheets to the same XML files.
This site also uses Jakarta TomCat, the Apache group's OpenSource Java Servlet Engine.