[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2][COLOR=#000000] [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2][COLOR=#000000] Save_Click([/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2][COLOR=#000000] sender [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#000000] System.Object, [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2][COLOR=#000000] e [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#000000] System.EventArgs) [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2][COLOR=#000000] Save.Click[/COLOR]
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] xtwcurrent [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Xml.XmlTextWriter
xtwcurrent = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Xml.XmlTextWriter([/SIZE][SIZE=2][COLOR=#800000]"C:\recipe\myrecipe.xml"[/COLOR][/SIZE][SIZE=2], System.Text.Encoding.UTF8)
[/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] xtwcurrent
.Formatting = Xml.Formatting.Indented
.WriteStartDocument()
.WriteDocType([/SIZE][SIZE=2][COLOR=#800000]"Recipe"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE][SIZE=2])
.WriteStartElement([/SIZE][SIZE=2][COLOR=#800000]"Recipe"[/COLOR][/SIZE][SIZE=2])
.WriteStartAttribute([/SIZE][SIZE=2][COLOR=#800000]"Name"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#800000]"Name"[/COLOR][/SIZE][SIZE=2], RName.Text)
.WriteEndAttribute()
[/SIZE][SIZE=2][COLOR=#008000]'.WriteEndElement()
[/COLOR][/SIZE][SIZE=2].WriteStartElement([/SIZE][SIZE=2][COLOR=#800000]"ingredient"[/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#800000]"ingredient"[/COLOR][/SIZE][SIZE=2])
.WriteValue([/SIZE][SIZE=2][COLOR=#800000]"test"[/COLOR][/SIZE][SIZE=2])
.WriteEndElement()
.WriteStartElement([/SIZE][SIZE=2][COLOR=#800000]"Name"[/COLOR][/SIZE][SIZE=2])
.WriteAttributeString([/SIZE][SIZE=2][COLOR=#800000]"Ingredient"[/COLOR][/SIZE][SIZE=2], Item.Text)
.WriteAttributeString([/SIZE][SIZE=2][COLOR=#800000]"Quantity"[/COLOR][/SIZE][SIZE=2], Quantity.Text, Measure.SelectedItem)
.WriteEndDocument()
.Close()
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]With
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]