Yes, like this. But I meant it by "string manipulation" version - you turn NimNodes to their string representation, construct a new string representation from them, then turn it back to NimNodes with parseStmt/parseExpr. It's the easiest way for your particular case.
By "manipulating directly" I suggested using `new...` procs (`newNode`, `newTree`, etc), as @alehander42 suggests you, first discovering AST, initial and desired, with `treeRepr`; that's a more general way, and more performant (for compile time), though less obvious and more verbose.
