Hi gurus.. Let me try this one more time, as I havent gotten much response on the last few questions. I have a form that contains a few text boxes, a couple of buttons, and a listbox.

This listbox is populated from an xml file upon loading the form. When clicking on one of the items in the listbox my textboxes are populated from the corrospoding xml nodes depending on which item is clicked in the listbox. With much consternation I was able to add a button that clears the textboxes, and another button that allows the user to enter info into the textboxes and click to save the items to the xml- the new item then shows up in the listbox.

The question I have is this: How do I apply a delete button that will delete an entry from the listbox? I tried using the removeall() and it seemed to delete everything from the xml file instead of the selected node. I attempted to use the removechild(), but that seems to do nothing. Below is the xml:

<?xml version="1.0"?>
<Sessionlist>
<session name="rx30">
<sessionname>rx30</sessionname>
<sessionhost>192.168.0.185</sessionhost>
<sessionuser>user</sessionuser>
<sessionpass>pass</sessionpass>
</session>
<session>
<sessionname>rx30extra</sessionname>
<sessionhost>192.168.0.200</sessionhost>
<sessionuser>user</sessionuser>
<sessionpass>pass</sessionpass>
</session>
</Sessionlist>

from this xml file the listbox has 2 items rx30 and rx30extra. When i click on rx30 the textboxes are populated with the sessionpass, sessionuser, sessionname. There is a delete button, and I want to be able to click it and delete the entire entry from <session> to </session> with the corrosponding <sessionname> which was selected from the listbox. Below is the code to populate the list, and display the textboxes:

Code:
    Dim xmlfile As String = "c:\sessionlist.xml"
    Dim xmldoc As New XmlDocument

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PopulateList()

    End Sub
    Private Sub PopulateList()
        xmldoc.Load(xmlfile)
        Dim openfile As New XmlTextReader(xmlfile)

        While openfile.Read
            If openfile.Name = "sessionname" AndAlso openfile.NodeType = XmlNodeType.Element Then
                ListBox1.Items.Add(openfile.ReadString)
            End If
        End While
        openfile.Close()
    End Sub


    Sub DisplayHosts(ByVal position As Integer)
        Dim node As XmlNode = xmldoc.SelectSingleNode( _
                "/Sessionlist/session[" & position & "]")
        hostname.Text = node.SelectSingleNode("sessionhost").InnerText
        userbox.Text = node.SelectSingleNode("sessionuser").InnerText
        pwbox.Text = node.SelectSingleNode("sessionpass").InnerText
        sessionname.Text = node.SelectSingleNode("sessionname").InnerText

    End Sub

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        DisplayHosts(ListBox1.SelectedIndex + 1)

    End Sub
Please help!!! If you have advise on editing the xml entries, that would be wonderful as wel!