I am generating XML in my c#, when I have few empty tags for example,
new XElement("TransLogID", "")
some of those gets rendered as
<TransLogID></TransLogID>
while some of those gets rendered as
<TransLogID/>
What controls when the tags will be expanded and when not? How can I force them to be in a behavior I want?
I think they have different origins.
will give
Both elements will have empty Elements/Nodes collections, the subtle difference is that the TransLogID2 will have IsEmpty=true.