/// <summary> /// Serializes the given messages to the given stream. /// </summary> public void Serialize(object message, Stream stream) { var messageType = mapper.GetMappedTypeFor(message.GetType()); using (var serializer = new XmlSerialization(messageType, stream, message, conventions, cache, SkipWrappingRawXml, Namespace)) { serializer.Serialize(); } }