if any property is blank or null then for that property xml tag is generated like </Attention>
but i want to generate it like <Attention></Attention>. so implement IXmlSerializable interface and from the WriteXml() method i tried to change the xml tag when the value is null or empty but still not getting right output. so please tell me what i need to do to generate the xml tag like <Attention></Attention> this if my Attention property is null or empty. basically i want customization of xml output. please guide me.
nullvalues are generally omitted rather than included as empty. However the self-closed<Attention/>is perfectly fine xml for an empty element. If you have a separate parser that complains about that, then the parser is at fault, not the serializer.