Private Sub CreateMenuWithXmlFile()
Dim path As String = "C:\MyXmlFile.xml"
Dim ds As New DataSet()
ds.ReadXml(path)
Dim menu As New Menu()
menu.MenuItemClick += New MenuEventHandler(menu_MenuItemClick)
For i As Integer = 0 To ds.Tables.Count - 1
Dim parentItem As New MenuItem(DirectCast(ds.Tables(i).TableName, String))
menu.Items.Add(parentItem)
For c As Integer = 0 To ds.Tables(i).Columns.Count - 1
Dim column As New MenuItem(DirectCast(ds.Tables(i).Columns(c).ColumnName, String))
menu.Items.Add(column)
For r As Integer = 0 To ds.Tables(i).Rows.Count - 1
Dim row As New MenuItem(DirectCast(ds.Tables(i).Rows(r)(c).ToString(), String))
parentItem.ChildItems.Add(row)
Next
Next
Next
Panel1.Controls.Add(menu)
Panel1.DataBind()
End Sub