How to serialize a property of type XMLNode



I have a public class with a property like:



[serializable]
public class Data
{
Public XmlNode VariableXMLData {get; set;}
}


The VariableXMLData node inturn contains an xmlnode. For example, say:



VariableXMLData.OuterXML is "
<VariableXMLData>
<Change>Major</Change><Reason>Unknown</Reason>
</VariableXMLData> ".


Issue is: When i serialize this class, the output looks like:



<Data>
<VariableXMLData>
<VariableXMLData>
<Change>Major</Change><Reason>Unknown</Reason>
</VariableXMLData>
</VariableXMLData>
</Data>


How can i avoid multiple tags for the element name over here. I want to have just one node for


No comments:

Post a Comment