We can't really answer this as we have no idea what your "document" consists of: it could be anything from a zip file containing XML (.epub) to a straight text file.
But... the String class has a Replace method which will do it for "basic" strings.
string replaced = inputString.Replace("user name", "Mike");
If that isn't what you need, you need to supply a whole load more info before we can help!