visit(root);// call recursive function with the root of the
// tree as your starting point
function visit(Node){
Iterator children = Node.getChildren();
// get all the children or branches or whatever you want
// to call them
while(it.hasNext(){
visit(it.next());
}
// then process your current node, or process it first
// depending on what exactly you're doing
}// end visit function