Asign handlers to menu built from .xml file

So, I have a menubar, entirely built using data from a .xml file. Nice!

Now I want to asign handlers to the menus (or menu items). I figure that it might be a way to insert into the xml the info for this and then extract this info and use it in as (eval, call).
But I’m not sure.

The only method I’m sure of is by using getMenuAt, which is kind of stupid.

Can anyone help me with this?