This depends on whether or not a user should be able to control what is shown in either menu.
If the main menu is a set of clickable images, you may wish to have a form that allows a user (a web designer) to upload and reference via our file browser control an image, associated with an page reference (a JSP or HTML page for example), some ALT text. This can be one compound element (a complexType) in the form, and it can be set to have 1 to n value. The advantage of this form is that the user can change images, change ALT text, change references, change ordering, etc. all without changing code.
Any web page generated - be it static or dynamic - can use this XML to generate the main menu. For a static site, a template can generate as an HTML fragment and all web pages can source it via a server-side include. For a dynamic site, you can have a JSP tag that implements the main menu sourcing directly from this example.
For the submenu, this can just be generated off the directory structure, whether you generate as a static HTML fragment or do so dynamic via a JSP tag.
Let me know if you have any more questions.
Kevin