fix Context confusion in websocket module
major refactoring of xml serialization to support incremental document generation.
incremental xml generation initial revision