XSLT is very simple but powerful way to handle dynamic transform. In this example i have used XML datasource and XSLT file for generating dynamic nested menu. The menu source is an SQL server database. The script for generating SQL table is also provided with solution.
Download source code of dynamic nested menu using XSLT