title: removing invalid XML characters from a string in java
body: <p>Hi
  i would like to remove all invalid XML characters from a string.
  i would like to use a regular expression with the string.replace method.</p>
  
  <p>like </p>
  
  <p><code>line.replace(regExp,"");</code></p>
  
  <p>what is the right regExp to use ?</p>
  
  <p>invalid XML character is everything that is not this :</p>
  
  <pre><code>[#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
  </code></pre>
  
  <p>thanks.</p>