posted 19 years ago
It was hard for me to understand just what you were trying to do with the code. Maybe it would be useful to just spell that out.
One thing I noticed is that your delete node method does not recursively remove children and grand-children of the node to be removed, first, so they get orphaned when their ancestr gets whacked. Depending on the function of the tree, this may not be a big deal, but I thought I would mention it.
Also, I'm not sure that it is all that useful to have the serialization/externalization use XML. Unless there's a specific reason why not, you might as well serialize the entire tree and write it as an ObjectStream. It should do the job just as well, unless you need to be able to modify the data in the serialized state.
HTH,
jdmaddison