Q:

How to select string with less amount of specfied xml tag with sql

I have a table where each item have a nvarchar(max) item with xml text.
I need some way to chose string with xml in which less amount of specified tag.
How to do this in faster way?
I read about STRING_SPLIT but it supported only with db with compatibility level 130 and I have compatibility level 110.
So for example I have two xml:
<main tag>
<child>
</child>
<child>
</child>
</main tag>

and 
<main tag>
<child>
</child>
</main tag>

I need to take 
   <main tag>
    <child>
    </child>
    </main tag>

Because the quantity of <child> tag in the second xml is less then in first xml string.
SOLUTION
I have found the solution. And Its pretty simple. 
Declare @TempXML Table (XMLText XML)
Insert into @TempXML 
Select t.XMLString from dbo.MyXMLProcedure t

Then
Select t.XMLText.VALUE('count(/main tag/child)','int') from @TempXML t

A:

In general, you can't determine the number of XML tags in an XML string using simple string operations, but assuming you are willing to live with the limitations, you can use:
(len(@string) - len(replace(UPPER(@string), UPPER(@xmltag), '')))/len(@xmltag)

to count the number of occurrences of a specific tag (e.g. use @xmltag = '<CHILD').
If you were working with an XML datatype column, you could use the XQuery count function:
SELECT xml.value('count /Main/Child')
FROM table

