Is there a Drupal way to loop over Webform fields in form alter function?
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.