Found exactly what was described:
The SourceText class has a WithChanges(...) method what returns with the new SourceText instance transformad by applied changes. The changes are in the form of a list of TextChange, which is basically a thin wrapper around TextSpan, containing the span itself and the replacement text.
Thanks anyone who spent time with this.