Can just use: if 'children' in node instead.