Hi sakthiT
As far as i know, there is no way other than this. We need to Iterators over child nodes.
Example:-
java.lang.Iterable<Node> custNode = JcrUtils.getChildNodes(content, "customer");
Iterator it = custNode.iterator();
//only going to be 1 content/customer node if it exists
if (it.hasNext())
{
//Count the number of child nodes to customer
Node customerRoot = content.getNode("customer");
Iterable itCust = JcrUtils.getChildNodes(customerRoot);
Iterator childNodeIt = itCust.iterator();
//Count the number of customer child nodes
while (childNodeIt.hasNext())
{
childRecs++;
childNodeIt.next();
}
I hope this will answer your question.
Thanks and Regards
Kautuk Sahni