Thanks Didi, That's almost exactly what I did, except I store the entire XPath in the Name property of the treenode. Every time a treenode gets created, I call a function GetXPath(tvwNode, xmlNode) that stores the XPath for that node in the treeview node Name property. Sacha