title: Get child count from rapidxml:xmlnode to get random child node
body: <p>I can turn my XML document file into <a href="/questions/tagged/rapidxml" class="post-tag" title="show questions tagged 'rapidxml'" rel="tag">rapidxml</a> object:</p>
  
  <pre><code>if(exists("generators.xml")) { //http://stackoverflow.com/a/12774387/607407
      rapidxml::file&lt;&gt; xmlFile("generators.xml"); // Open file, default template is char
  
      xml_document&lt;&gt; doc;               // character type defaults to char
      doc.parse&lt;0&gt;(xmlFile.data());;    // 0 means default parse flags
      xml_node&lt;&gt; *main = doc.first_node();  //Get the main node that contains everything
      cout &lt;&lt; "Name of my first node is: " &lt;&lt; doc.first_node()-&gt;name() &lt;&lt; "\n";
  
      if(main!=NULL) {
          //Get random child node?
      }
  }
  </code></pre>
  
  <p>I'd like to pick one random child node from the main object. My XML looks like this (<a href="http://pastebin.com/mrsxGRYZ" rel="nofollow">version with comments</a>):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="windows-1250"?&gt;
  &lt;Stripes&gt;
    &lt;Generator&gt;
       &lt;stripe h="0,360" s="255,255" l="50,80" width="10,20" /&gt;
    &lt;/Generator&gt;
    &lt;Generator&gt;
       &lt;loop&gt;
         &lt;stripe h="0,360" s="255,255" l="50,80" width="10,20" /&gt;
         &lt;stripe h="0,360" s="255,255" l="0,0" width="10,20" /&gt;
       &lt;/loop&gt;
    &lt;/Generator&gt;
  &lt;/Stripes&gt;
  </code></pre>
  
  <p>I want to pick <strong>random <code>&lt;Generator&gt;</code> entry</strong>. I think getting the child count would be a way to do it:</p>
  
  <pre><code>//Fictional code - **all** methods are fictional!
  unsigned int count = node-&gt;child_count();
  //In real code, `rand` is not a good way to get anything random
  xmlnode&lt;&gt; *child = node-&gt;childAt(rand(0, count));
  </code></pre>
  
  <p>How can I get child count and child at offset from rapidxml node?</p>