It's not actully that hard to write these sorts of menus. Course the code that xara produces has to handle every posible type of site so it's rather large and complex. But if you make your own menu your code can be quite simple.
I'd use css to do the menu these days rather than javascript. Have a look at the tutorial on http://www.alistapart.com/articles/dropdowns/
You should be able to work your php in to just make a for or while loop to write extra <li> elements into the menu so it will adapt to your database.