it’s not clear to me what you exactly mean (please be more detailed in your description in the future).
This is just a guess, from my understanding what you are trying to do is to iterate the hst:root node within your (HST?) application. Then you are trying to compare this result (more specifically the number of children of the root node) with the tree you see from the console application  : in this case the root node displays more children compared to first result.
If my assumptions are correct, then you are using two different users while performing those two operations. The 1st user - that you are using in your specific application - has less privileges than the 2nd one (that most likely is an admin user). Please have a look at  in order to understand how Authorization works in general in the CMS.
here before iterating through all the child nodes of root node when i check the size through
nodeItr.getSize(), I get size as 13. which are same as when we login to cms/console and check, which are( [collections],[content],[formdata],[hcm:hcm],[hippo:configuration],
However when I iterate though it, I only get [content],[hippo:configuration],
Other nodes are missing. while loop runs just 7 times and then it breaks out.why is it happening so?
Please let me know how can i access all sites listed under “hst:hst/hst:sites” and their properties?