title: Docx content replacement
body: <pre><code>using (WordprocessingDocument wordDoc = 
         WordprocessingDocument.Open(document, true))
  {
      string docText = null;
      using (StreamReader sr = 
             new StreamReader(wordDoc.MainDocumentPart.GetStream()))
      {
          docText = sr.ReadToEnd();
      }
  
      Regex regexText = new Regex("@@username@@");
      docText = regexText.Replace(docText, "john thomas ");
  
      using (StreamWriter sw = 
             new StreamWriter(wordDoc.MainDocumentPart.GetStream(FileMode.Create)))
      {
          sw.Write(docText);
      }
  }
  </code></pre>
  
  <p>This should replace matches on doctext by the name in the code. I checked the doctext and the word to replace (<code>@@username@@</code>) is split. There is sometimes XML contents between the 
  <code>@@</code> and <code>username@@</code>. Sometimes the word itself is malformed.</p>
  
  <p>How do I replace <code>@@username@@</code>?</p>