title: Rapidxml traversing nodes
body: <p>the xml file:</p>
  
  <pre><code>&lt;top&gt;
      &lt;name&gt;hanhao&lt;/name&gt;
      &lt;age&gt;18&lt;/age&gt;
  &lt;!--
      node name : name
      node value : hanhao
  
      node name : age
      node value : 18
  --&gt;
  &lt;/top&gt;
  </code></pre>
  
  <p>my cpp file:</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include"rapidxml/rapidxml.hpp"
  #include"rapidxml/rapidxml_print.hpp"
  #include"rapidxml/rapidxml_utils.hpp"
  using namespace std;
  using namespace rapidxml;
  void handlenode(xml_node&lt;&gt; *node){
      for(node = node -&gt; first_node(); node != NULL; node = node -&gt; next_sibling()){
          cout&lt;&lt;node -&gt; name() &lt;&lt;" 's value is : "&lt;&lt;node-&gt;value() &lt;&lt;endl;
          handlenode(node);
      }
  }
  int main(){
      char xmldoc[] = "demo.xml";
      file&lt;&gt; file(xmldoc);
      xml_document&lt;&gt; doc;
      doc.parse&lt;parse_comment_nodes&gt;(file.data());
      xml_node&lt;&gt; *node = doc.first_node();
      handlenode(node);
      doc.allocate_node(node_element,"",node-&gt;value());
      return 0;
  }
  </code></pre>
  
  <p>the output expected is :</p>
  
  <p><strong>name 's value is : hanhao</strong></p>
  
  <p><strong>age 's value is : 18</strong></p>
  
  <p>but the real output is :</p>
  
  <p><strong>name 's value is : hanhao</strong></p>
  
  <p><strong>'s value is : hanhao</strong></p>
  
  <p><strong>age 's value is : 18</strong></p>
  
  <p><strong>'s value is : 18</strong></p>
  
  <p><strong>'s value is :</strong></p>
  
  <p><strong>node name : name</strong></p>
  
  <p><strong>node value : hanhao</strong></p>
  
  <p><strong>node name : age</strong></p>
  
  <p><strong>node value : 18</strong></p>
  
  <p>who can tell me why this problem occurs?</p>