Can we force XmlWriter to issue <my-tag></my-tag> rather than <my-tag/>?
If you get the message Extension method can only be declared in non-generic, non-nested static class
as the word this
may be highlighted, simply create an extension class as shown below:
public static class Extension{ public static void WriteFullElementString(this XmlTextWriter writer, string localName, string value) { writer.WriteStartElement(localName); writer.WriteRaw(value); writer.WriteFullEndElement(); }}
Hope this proves useful :-)