title: How return leaf nodes of a boost::property_tree
body: <p>I have a property tree where all the data is stored in its leaf nodes. The Tree, however, has a complex structure. What I want to do now is:</p>
  
  <ol>
  <li>get all (and only the) leaf nodes of the tree, for they contain the data and</li>
  <li>recall the path leading to the respective leaf node</li>
  </ol>
  
  <p>Eventually, I want to receive a key/value pair of all (and only the) leaf nodes where the key contains the complete path to the node and the value contains the node's value.</p>
  
  <p>My questions are: </p>
  
  <ol>
  <li>Is there a more convenient way than to recursively iterate through the whole tree, store the respective path and read out the values of the nodes that don't have children (i.e. a "<em>get_leaves()</em>" function)?</li>
  <li>If I have some pointer to a subtree (<em>ptree</em> variable, <em>iterator</em>, whatever..) of a given tree, is there a method to easily determine the relative path of that subtree inside the tree?</li>
  </ol>