- wxString pname = name.BeforeLast(_T('/'));
- if (pname.IsEmpty()) pname = name;
- wxXmlNode *p = XmlFindNode(parent, pname);
- if (p == NULL) p = parent;
- n = new wxXmlNode(wxXML_ELEMENT_NODE, name.AfterLast(_T('/')));
- p->AddChild(n);
- n->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString));
+ parent = n;
+ nm = tkn.GetNextToken();
+ n = XmlFindNodeSimple(parent, nm);
+ if (n) continue;
+
+ // n == NULL:
+ n = new wxXmlNode(wxXML_ELEMENT_NODE, nm);
+ parent->AddChild(n);