Indent/Undent Nodes

I was able to get access to the nodes in question using nodesAt(index)

Now I am struggling to combine multiple transactions for insertText() on multiple lines

It works fine on a single line but im not sure how to apply many transactions of insertText.

Any ideas how this would be done?

I tried:

tr.step(new ReplaceAroundStep(currentStart, currentStart, 0, 0, new Slice(newFragment, 0, 0), 0, false));

but I am not sure how to build the newFragment or if ReplaceAroundStep is the right approach

Thanks in advance