XML:getNameCount([path,] name)

Count the number of child elements that have a given name.

When only one argument is specified, this method returns a count of the number of child elements of the current node that have the given name. When the two argument form is used, the first argument must be a path and the second argument is the name of the elements to count.
Example
doc=xml.parse(str)
count=doc:getNameCount('bar')
count=doc:getNameCount('/foo/bar', 'baz')