title: Adding a sub child to boost ptree
body: <p>Lets say I am aiming to create an xml in the following form:</p>
  
  <pre><code>&lt;main&gt;
  &lt;elements&gt;
      &lt;element name="elem1"&gt;&lt;temp/&gt;
      &lt;/element&gt;
      &lt;element name="elem2"&gt;&lt;temp/&gt;
      &lt;/element&gt;
  &lt;/elements&gt;
  &lt;/main&gt;
  </code></pre>
  
  <p>I have the following code:</p>
  
  <pre><code>ptree pt;
  pt.put("main","");
  
  ptree temp1;
  temp1.put("element","");
  temp1.put("element.&lt;xmlattr&gt;.name","elem1");
  temp1.put("element.temp");
  
  ptree temp2;
  temp2.put("element","");
  temp2.put("element.&lt;xmlattr&gt;.name","elem2");
  temp2.put("element.temp");
  
  //temp1 represents the 1st &lt;element&gt;...&lt;/element&gt;
  //temp2 represents the 1st &lt;element&gt;...&lt;/element&gt;
  
  //Add temp1 and temp2 to &lt;main&gt; under &lt;elements&gt;
  </code></pre>
  
  <p>I would assume the following would work:</p>
  
  <pre><code>pt.add_child("main.elements",temp1);
  pt.add_child("main.elements",temp2);
  </code></pre>
  
  <p>However this generates the following xml:</p>
  
  <pre><code>&lt;main&gt;
  &lt;elements&gt;
      &lt;element name="elem1"&gt;&lt;temp/&gt;
      &lt;/element&gt;
  &lt;/elements&gt;
  &lt;elements&gt;
      &lt;element name="elem2"&gt;&lt;temp/&gt;
      &lt;/element&gt;
  &lt;elements&gt;
  &lt;/main&gt;
  </code></pre>
  
  <p>I was able to get the required xml file by making my temp1  in the following form:</p>
  
  <pre><code>temp1.put("&lt;xmlattr&gt;.name","elem1");
  temp1.put("temp","");
  temp2.put("&lt;xmlattr&gt;.name","elem2");
  temp2.put("temp","");
  pt.add_child("main.elements.element",temp1);
  pt.add_child("main.elements.element",temp2);
  </code></pre>
  
  <p>Is there a way I can work with my initial temp1 and temp2 nodes to get the desired xml structure?</p>