Index: /trunk/include/VBox/vmm/cfgm.h
===================================================================
--- /trunk/include/VBox/vmm/cfgm.h	(revision 46791)
+++ /trunk/include/VBox/vmm/cfgm.h	(revision 46792)
@@ -88,4 +88,5 @@
 
 VMMR3DECL(PCFGMNODE)    CFGMR3CreateTree(PUVM pUVM);
+VMMR3DECL(int)          CFGMR3DestroyTree(PCFGMNODE pRoot);
 VMMR3DECL(void)         CFGMR3Dump(PCFGMNODE pRoot);
 VMMR3DECL(int)          CFGMR3DuplicateSubTree(PCFGMNODE pRoot, PCFGMNODE *ppCopy);
Index: /trunk/src/VBox/VMM/VMMR3/CFGM.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/CFGM.cpp	(revision 46791)
+++ /trunk/src/VBox/VMM/VMMR3/CFGM.cpp	(revision 46792)
@@ -1911,7 +1911,7 @@
 
 /**
- * Remove a node.
- *
- * @param   pNode       Parent node.
+ * Removes a node.
+ *
+ * @param   pNode       The node to remove.
  */
 VMMR3DECL(void) CFGMR3RemoveNode(PCFGMNODE pNode)
@@ -2018,4 +2018,21 @@
         pLeaf->enmType = (CFGMVALUETYPE)0;
     }
+}
+
+/**
+ * Destroys a tree created with CFGMR3CreateTree or CFGMR3DuplicateSubTree.
+ *
+ * @returns VBox status code.
+ * @param   pRoot       The root node of the tree.
+ */
+VMMR3DECL(int) CFGMR3DestroyTree(PCFGMNODE pRoot)
+{
+    if (pRoot)
+        return VINF_SUCCESS;
+    AssertReturn(!pRoot->pParent, VERR_INVALID_PARAMETER);
+    AssertReturn(!pRoot->pVM || pRoot != pRoot->pVM->cfgm.s.pRoot, VERR_ACCESS_DENIED);
+
+    CFGMR3RemoveNode(pRoot);
+    return VINF_SUCCESS;
 }
 
Index: /trunk/src/VBox/VMM/VMMR3/VMMR3.def
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/VMMR3.def	(revision 46791)
+++ /trunk/src/VBox/VMM/VMMR3/VMMR3.def	(revision 46792)
@@ -4,5 +4,5 @@
 
 ;
-; Copyright (C) 2010-2011 Oracle Corporation
+; Copyright (C) 2010-2013 Oracle Corporation
 ;
 ; This file is part of VirtualBox Open Source Edition (OSE), as
@@ -30,4 +30,5 @@
     CFGMR3Dump
     CFGMR3CreateTree
+    CFGMR3DestroyTree
     CFGMR3GetValueName
     CFGMR3GetName
