Question: How would you remove a node from boost xml property tree?

I have a document like this:

```
<folders>
  <folder>some/folder</folder>
  <folder>some/folder</folder>
  <folder>some/folder</folder>
</folders>

```

I know how to itereate and print all folders, but how would i remove one of the items and save the xml back?

Answer: 
I would probably try:

```
boost::property_tree::ptree pt;

pt.erase(key);

```
```
   // Recursively erase nodes
   void prune_nodes(ptree& Prop_tree, const char* Node_name)
   {
        ptree::iterator Root = Prop_tree.begin(); // Node iterator
        ptree::iterator End = Prop_tree.end(); // Stop sentinel
        // Loop through current 'Root-Level'
        for(Root; Root != End; Root++) 
        {
            Root->second.erase(Node_name); // Erase nodes in current 'Root-Level' sub-tree
            prune_nodes(Root->second, Node_name); // Recurse using current sub-tree as next call's ptree
        }
   }

```