menu component hideItem on xml ?

Hello I would like to ask if there is an attribute which can be used in the xml(which creates the menu) so a specific item to be hidden.Like calling hideItem(itemId).
In other words is it possible to hide an item when initializing the menu via xml?
Thanks!

You can add userdata for items that you want to hide. And after xml is loaded, you should call hideItem for them:

thanks