Each approver will get a task assigned (sequentially) and are also able to add an additional approver to the sequence. When approver 1 adds an additional approver, this approver needs to be added between node 1 and node 2 of my repeating section:

Name approver

Comments

Approver 1

populated through WF

New approver

Approver 2

populated through WF

Approver 3

populated through WF

Did anyone get this working?

I can add the user to the repeating section as an additional (last) node - not the correct outcome as the sequence of the approvers is important.

Replacing the first node its contents with <ApproverName>name of first approver</ApproverName><ApproverComments>comments</ApproverComments></item><item><ApproverName>name of newly added approver</ApproverName><ApproverComments>comments</ApproverComments> results in an Update XML error and the workflow gets suspended.

Manipulating repeating section is not very easy. You can read my blog about that here: Dynamic repeating section - how to however it mainly refers to altering the section dynamically, as the form's values are changed.

Also, be aware you cannot replace the firs row of the repeating section. This is always a hidden row, shouldn't be modified or deleted, as is used as a definition for the section.

So I would try to not replace it with a new, but to replace it with its contents + the new node.

maybe I wasn't too precise. What I meant was that you shouldn't manipulate the first row on the form itself. If you go with the developer console you will find, that above your visible first row there is also a hidden one, so in fact the first is a different one than you see.

However manipulating the XML shouldn't bring any errors as long as you stay inline with the schema. Have you logged out the text you are building? Maybe there was an issue with the text you built?