If you want to get all projct childs from a root project jus use ProjTable::getChildProjectsFromRootProject.
The method returns a List of ProjTable.
Here you can find an example on how to use it
ProjId rootProj = projTable::getRootProjId(projId);
List _projList = new List(Types::Record);
List list = projTable::getChildProjectsFromRootProject(rootProj, _projList);
Enumerator en;
en = list.getEnumerator();
boolean found = false;
while (en.moveNext())
{
if(en.current() is ProjTable)
{
ProjTable projTable = en.current() as ProjTable;
if (projParentId == projTable.ProjId)
{
found = true;
}
}
}