Help counting XML nodes with a catch

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?


<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>