This is fine, but code normally uses a macro to iterate:

ForEachChild(i, expr)