The string being passed comes from an Excel XML file of 142k. That might be why it causes a problem. I also found that extremely slow when processing with such a big string. However, when using the regular .NET Replace() functionality as is, the result is instant.
OK. Are you trying to append the XML file to the end of the string (represented in stringbuilder)....or are you trying to insert it in a specific location within the existing string?