Is it possible to save "menu definitions" in an Xml file and then read them and implement the menu of the MainWindow?

Assume the following definition (well formed XML):

Qt Code:
  1. //<DTD etc goes here>
  2.  
  3. <menu name="file">
  4. <menuItem>New</menuItem>
  5. <submenu name="preferences">
  6. <submenuItem>A</submenuItem>
  7. <submenuItem>B</submenuItem>
  8. </submenu>
  9. </menu>
To copy to clipboard, switch view to plain text mode 


How would I read this file and implement a menu out of this...I went through the doc but am not v.clear as to the syntax to use to implement a menu out of the XML file!



Thanks in advance!

Nupul