Q:

How to find the number of elements/tags present under specific tag?

How to find the total number of elements/tags present under specific tag ?
<div id="mainTag class='mainTag'>
     <div id="subMainTag1" class="subMainTag1">
         <div id="subTag1" class="subTag1">
              <div some inner tags again>
                  <div some inner tags again>
         <div id="subTag1" class="subTag1">
               <div some inner tags again>
                  <div some inner tags again>
         <div id="subTag1" class="subTag1">
                <div some inner tags again>
                  <div some inner tags again>
         <div id="subTag1" class="subTag1">
                <div some inner tags again>
                  <div some inner tags again>

I am looking for div tags having id and class subTag1.As per snippet provided above, i need to get the count value as 4.
verifyXpathCount does not return the counts.
storeXpathCount | //div[@id='mainTag']/div[@id='subMainTag1']/div | count
echo ${count}

storeXpathCount | //div[@id='mainTag']/div[@id='subMainTag1']//div | count
echo ${count}

storeXpathCount | //div[@id='mainTag']/div[@id='subMainTag1']/* | count
echo ${count}

All above returns 0, Nothing returns actual value 4. Not sure, what i am missing here.
Selenium IDE/web-driver:python , anything is fine. 
ANSWER:
storeXpathCount working fine. I had missed to select frame.
Get Matching XPath Count also works fine in Robot Framework.

A:

Adding to kjhughes's answer, since he didn't understand you were trying to achieve this using Robot Framework. It wasn't that clear, to his defense.
Using the XPath he provided, you could use the Xpath Should Match X Times keyword. Something like this:
XPath Should Match X Times    //div[@id='mainTag']/*    4

If you need to store the retrieved matching count, you can use the quite similar keyword, Get Matching XPath Count, like this:
${count}=    Get Matching XPath Count    //div[@id='mainTag']/*

