# Help counting XML nodes with a catch

**URL:** <https://forum.kirupa.com/t/help-counting-xml-nodes-with-a-catch/316676>\
**Category:** flash\
**Created:** [November 29, 2010, 6:34pm UTC](https://forum.kirupa.com/t/help-counting-xml-nodes-with-a-catch/316676 "2010-11-29T18:34:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m2244](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@m2244](https://forum.kirupa.com/u/m2244)\
**Post date:** [November 29, 2010, 6:34pm UTC](https://forum.kirupa.com/t/help-counting-xml-nodes-with-a-catch/316676/1 "2010-11-29T18:34:05Z")

</div>

Hello,

I am trying to count the number of nodes in an XML file but the names of the nodes will differ slightly, probably by a number. In the code below I need to know how many ‘commandx’ nodes I have, ‘x’ being a number. Any thoughts?

```auto

<requiredRootNode>
 <command1>
  <commText>hereisthefirstcommand</commText>
  <output>Usage: BROWSTAT Command </output>
  <explanation>Here is an opportunity to explain some of the finer points of the command.</explanation>
 </command1>
 
<command2>
  <commText>hereisthefirstcommand</commText>
  <output>Usage: BROWSTAT Command </output>
  <explanation>Here is an opportunity to explain some of the finer points of the command.</explanation>
 </command2>
</requiredRootNode>

```
