How to convert a webform into an ordered list? I've tried to preprocess a webform in order to convert the form items into an ordered list. My webform is composed of questions, and I want each question to be a enumerated list element.



The problem is that I cannot find where to convert the &lt;div&gt; following the &lt;form&gt; into an &lt;ol&gt;, and the next nested &lt;div&gt; into an &lt;li&gt;. After navigating webform's source code I could not find a function that says "give me all the webform elements", for example. It all seems to work in the following order:


implement hook node load (load webform components)
implement hook node view (order webform components into a structure that is hard to modify?)
create form
render form using some theming functions


When I use the node preprocessor to alter the components (and attempt to insert a #type = item_list somewhere), it doesn't work. And when using one of the webform theming functions, the data structure comes in a way that is hard to modify. Example:



That variable that I tried to modify was the $variables['elements']['webform']['#form']['submitted'] in a hook_preprocess_node.
Install Theme Developer and look for theming function name.