def _NodeHasAllLeafChildren(node):
  """Determines whether the given node's children are all leaf nodes.

  Note that a node with no children does *not* have all leaf children.
  """
  if not node.HasChildren():
    return False

  for child in node.GetChildren():
    if child.HasChildren():
      return False
  return True