Is there a Drupal way to loop over Webform fields in form alter function? Since $form['submitted'] array has also other keys than just field names e.g. #tree, what is the correct way to loop over this array?

I need to add a #prefix and #suffix for each field and for now I've just created condition !is_numeric(strpos($fName,"#"))
This tells if it just a field name or if it holds render array properties or whatever they are called.
For D7 use element_children:

Identifies the children of an element array, optionally sorted by weight.
The children of a element array are those key/value pairs whose key does not start with a '#'. See drupal_render() for details.

E.g.
foreach (element_children($form['submitted'] as $key) {
    $form['submitted'][$key]['#prefix'] =&gt; 'foo',
}

For D8, use the equivalent Element::children in the same manner.