http://bytes.com/topic/net/answers/178893-force-xmlserializer-use-explicit-closing-tags-zero-length-strings
I wanted to serialize an empty object to
xmlSerialize.serialize produced
So here's a rough conversion:
Imports System.Xml.Serialization
Public Class XMLTextWriterEE
Inherits XmlTextWriter
Public Sub New(ByVal sink As TextWriter)
MyBase.New(sink)
End Sub
'''
''' Wrapper that forces more compact empty element end tags to be written whenever possible.
'''
Public Overrides Sub WriteEndElement()
MyBase.WriteFullEndElement()
End Sub
serializer.Serialize( new XmlTextWriterEE( destTextWriter), obj)
