You should map a list of children to a menu item class. That way each instance of a menu item also contains its children and you can easily iterate them. All you have to do is to select menu items where ParentId=0.
MenuItem-class:
[Bag(0, Name = "Children", Inverse = true, Lazy = CollectionLazy.False)]
[Key(1, Column = "MenuItemParentId")]
[OneToMany(2, ClassType = typeof(MenuItem))]
public virtual IList<menuitem> Children
{
get { return _children; }
set { _children = value; }
}
</menuitem>
Or by xml mapping (must still have the Children property in the class, though):
<bag name="Children" lazy="false" inverse="true">
<key column="MenuItemParentId" />
<one-to-many class="Your.Namespace.MenuItemParentId, Your.Namespace" />
</bag>