My current XML structure is:
<Parent>
<Child>
<Line id="1">Something</Line>
<Line id="2">Something</Line>
</Child>
<Child>
<Line id="1">Something else</Line>
<Line id="2">Something else</Line>
</Child>
</Parent>
Parent class code contains property:
[XmlElement("Child")]
public List<Child> Childrens { get; set; }
Now I want this to be changed to:
<Parent>
<Child>
<Line id="1">Something</Line>
<Line id="2">Something</Line>
</Child>
<SpecialChild>
<Line id="1">Some other text</Line>
<Line id="2">Some other text</Line>
</SpecialChild>
</Parent>
I.e. when Child has some special flag set, it's name should be changed, and some other text be printed. Child already knows what text to print depending on flag.
But what will be the best option to change element name now?