title: How do I get an Ampersand symbol into Word 2007 .docx XML file?
body: <p>I am generating a Word doc in xml based on customer input, and of course it blows up whenever an <code>&amp;</code> is used. I tried replacing all instances of <code>&amp;</code> with <code>&amp;amp;</code>, but then <code>&amp;amp;</code> literally shows up in my Word Doc. Here's my code:</p>
  
  <pre><code>        static String replace(String in) {
              String ampersand = "&amp;(?![a-zA-Z][a-zA-Z][a-zA-Z]?[a-zA-Z]?;)";
              return in.replaceAll(ampersand,"&amp;amp;");
          }
  </code></pre>
  
  <p>Any ideas?</p>