Using XML in the .NET Framework "  Chapter 4 155 Figure 4.25  Continued entryNode.ParentNode.RemoveChild(entryNode); this.lstEntries.SelectedItems[0].Remove(); this.clearEntryDetail(); } else { MessageBox.Show("You must select an entry"); } } After it has been verified that the user selected an entry, an XPath expression is built to select the specific entry element the user is deleting, which is exactly the same as the XPath expression built to find a node to edit. Next, the specific entry element is selected, and its parent nodes RemoveChild() method is called, passing itself as the child to remove. Finally, the entry list box is updated and the entry detail text boxes are cleared so the user doesnt attempt to edit the newly deleted entry. www.syngress.com 155_xml_net_pd_C04.qk  3/6/02  1:57 PM  Page 155