Index: trunk/ippTools/src/pxtree.c
===================================================================
--- trunk/ippTools/src/pxtree.c	(revision 15167)
+++ trunk/ippTools/src/pxtree.c	(revision 15187)
@@ -34,5 +34,5 @@
 }
 
-pxNode *pxNodeAlloc(const char *name, pxNode *parent)
+pxNode *pxNodeAlloc(const char *name)
 {
     PS_ASSERT_PTR_NON_NULL(name, NULL);
@@ -41,14 +41,5 @@
 
     node->name = psStringCopy(name);
-
-    // parent == NULL basically means that this is the root node
-    if (!parent) {
-        node->parent = NULL;
-    } else {
-        // add this node to it's parent's children list
-        psListAdd(parent->children, PS_LIST_TAIL, node);
-        node->parent = psMemIncrRefCounter(parent);
-    }
-
+    node->parent = NULL;
     node->children = psListAlloc(NULL);
 
@@ -58,4 +49,27 @@
 }
 
+pxNode *pxNodeAddParent(pxNode *node, pxNode *parent)
+{
+    // add this node to it's parent's children list
+    psListAdd(parent->children, PS_LIST_TAIL, node);
+    // and set the parent pointer
+    node->parent = psMemIncrRefCounter(parent);
+
+    return node;
+}
+
+pxNode *pxNodeAddChild(pxNode *node, pxNode *child)
+{
+    // add the child node to this nodes list of children
+    psListAdd(node->children, PS_LIST_TAIL, child);
+    // if the child already has a parent, release the ref count
+    if (child->parent) {
+        psMemDecrRefCounter(child->parent);
+    }
+    // [re]parent the child
+    child->parent = psMemIncrRefCounter(node);
+
+    return node;
+}
 
 void pxNodePrint(FILE *stream, pxNode *node)
@@ -145,7 +159,27 @@
             continue;
         }
-        pxNode *parent = psHashLookup(nodeNames, item->data.str);
-        pxNode *node = pxNodeAlloc(item->name, parent);
-        psHashAdd(nodeNames, item->name, node);
+
+        // try to find a node with this name
+        pxNode *node = psHashLookup(nodeNames, item->name);
+        if (!node) {
+            // create a new node with this name
+            node = pxNodeAlloc(item->name);
+            // add it to the hash of nodes
+            psHashAdd(nodeNames, item->name, node);
+        }
+
+        // does this node declare a child?
+        if (item->data.str) {
+            // try to find a node with this name
+            pxNode *child = psHashLookup(nodeNames, item->data.str);
+            if (!child ) {
+                // create a new node with this name
+                child = pxNodeAlloc(item->data.str);
+                // add it to the hash of nodes
+                psHashAdd(nodeNames, item->data.str, child);
+            }
+            pxNodeAddChild(node, child);
+        }
+
         psFree(node);
     }
Index: trunk/ippTools/src/pxtree.h
===================================================================
--- trunk/ippTools/src/pxtree.h	(revision 15167)
+++ trunk/ippTools/src/pxtree.h	(revision 15187)
@@ -36,7 +36,9 @@
 
 pxNode *pxNodeAlloc(
-    const char *name,
-    pxNode  *parent
+    const char *name
 ) PS_ATTR_MALLOC;
+
+pxNode *pxNodeAddParent(pxNode *node, pxNode *parent);
+pxNode *pxNodeAddChild(pxNode *node, pxNode *child);
 
 void pxNodePrint(
@@ -59,11 +61,3 @@
 pxNode *pxTreeFromMetadata(psMetadata *md);
 
-
-/*
-bool pxNodeAddChild(
-    pxNode  *parent,
-    pxNode  *child
-);
-*/
-
 #endif // PXTREE_H
