title: Updating XML file using Boost property_tree
body: <p>I have the following XML file:</p>
  
  <pre>
  &lt;xml version="1.0" encoding="utf-8"?>
  &lt;Data>
      &lt;Parameter1>1&lt;/Parameter1>
  &lt;/Data>
  </pre>
  
  <p>I want to add a new node: Parameter2="2" to the Data node. This code doesn't work, saved file still contains only one parameter:</p>
  
  <pre>
      boost::property_tree::ptree tree;
      boost::property_tree::ptree dataTree;
  
      read_xml("test.xml", tree);
      dataTree = tree.get_child("Data");
      dataTree.put("Parameter2", "2");
  
      boost::property_tree::xml_writer_settings w(' ', 4);
      write_xml("test.xml", tree, std::locale(), w);
  </pre>
  
  <p>If I add these two lines after dataTree.put, I get correct result:</p>
  
  <pre>
      tree.clear();
      tree.add_child("Data", dataTree);
  </pre>
  
  <p>I don't like this solution, because it creates problems with more complicated tree structutes. Is it possible to update property tree without deleting/adding child nodes?</p>