Recursive pseudocode with firstChild and nextSibling:
int maxChildren = findMaxChildren(root, 0);
int findMaxChildren(TreeNode root, int max) {
if (root.getChildren().length > max) max = root.getChildren().length;
TreeNode e = root.firstChild();
while (e != null) {
int tmp = findMaxChildren(e, max);
if (tmp > max) max = tmp;
e = e.nextSibling();
}
return max;
}