title: How to transform Source with invalid XML characters
body: <p>I am working on a case where I need to clean invalid XML characters I receive from a SharePoint web service.
  I know fixing the source is the right thing to do - however this issue has been reported back in 2008, and I have yet to find that Microsoft has released a patch for it.</p>
  
  <p>For now, I call the Web Service using the Provider interface from JAX-WS. I receive the Source with the returned XML just fine, but I'm stuck trying to find a way to transform the source to valid XML DOM.</p>
  
  <p>I get an exception complaining about the illegal XML character every time I try something like the following pseudo code:</p>
  
  <pre><code>public void xmlTranform(javax.xml.transform.Source source) {
       StreamResult sr = new StreamResult(new java.io.StringWriter());
       Transformer tf = TransformerFactory.newInstance().newTransformer();
       tf.transform(source, sr);
       ...
  </code></pre>
  
  <p>Would it be possible to create a custom FilterReader and insert it into the Transformation?</p>
  
  <p>Or could I customize the Marshaller maybe?</p>
  
  <p>What would be the best way to inject code into the transformation to filter out those invalid characters?</p>