title: Extract immediate child of a tag in XML string without any libraries
body: <p>Say I have the below xml string : </p>
  
  <pre><code>&lt;root&gt;  
   &lt;a&gt;  
       &lt;c&gt;  &lt;/c&gt;
   &lt;/a&gt;
  
   &lt;b&gt;  &lt;/b&gt;
  
  &lt;/root&gt;
  </code></pre>
  
  <p>Say i want <strong>immediate children</strong> of 'root' my approach : </p>
  
  <ol>
  <li><p>Extract tags inside root by using regex:</p>
  
  <p><strong>extractedString = myXmlString.match(/&lt;(\w+)([^>]<em>)>([\s\S]</em>)&lt;/\1>/g)[3]</strong></p></li>
  <li><p>use a regex to get the child tags , but it gives me all the children i use this regex on the extracted string (i.e. the string between the root tags)</p>
  
  <p><strong>childArray = extractedString.match(/&lt;\w+/g)</strong></p></li>
  </ol>
  
  <p>but the above one also returns me <strong>c</strong>  which is obvious , is there any way of extracting only <strong>a</strong> and <strong>b</strong> . or is this approach wrong? I am not looking forward to use any library please do correct me if my approach is wrong towards this (i.e. using regex) and suggest the correct way of doing this.</p>