<p>I have a Java server that accepts SSL connections using JSSE and uses a simple XML message format inside the stream.  I would like the server to read a complete message and then send a reply.  This turns out to be quite difficult because org.xml.sax.XMLReader wants to read the entire stream and then call close().  I know it seems strange, but in Java 6 with the Sun JSSE provider this really does close both ends of the SSLSocket so no message can go back.  I tried using the shutdownOutput() method of Socket on the client side, but this is unsupported with JSSE.</p>

<p>My solution was to pass an InputStream wrapped in a custom class that silently ignores close requests and indicates that the stream is closed when it encounters the first blank line.  This constrains the XML beyond what is normally valid, but the client can easily filter out blank lines in the input if necessary.  Is there a better solution?</p>

I'm guessing that you are already doing dynamic assembly resolution and loading? If so, then you could try substituting a fake assembly name in place of the real assembly name i n the Xaml - you can then use that in your assembly resolution code to load up and return the right assembly. e.g. if your original source Xaml is:
```
```
xmlns:myassembly="clr-namespace:MyApp.MyAssembly;assembly=MyAssembly"
```
```
and you know that Xaml wants v2 of MyAssembly, replace the assembly ref in the Xaml string before parsing it to:
```
```
xmlns:myassembly="clr-namespace:MyApp.MyAssembly;assembly=MyAssembly.v2"
```
```
.. then in your assembly resolution / load code, when you see the ".v2" bit on the end you look for and load that assembly instead.
Please let me know if I've misunderstood the question, or you aren't current doing any custom assembly resolution - that would certainly be the key in this situation I think.