I have a very specific deserialization need, see example below:
say I have following class:
[Serializable]
public class Person {
public string Name { get; set; }
public string PersonXml { get; set; }
}
and following XML
<Person> <Name>John</Name> <PersonXml><someXmlFragment>text</someXmlFragment></PersonXml> </Person>
What I want is the XmlSerializer class to deserialize InnerXml of the <PersonXml> element to the PersonXml property as a string. I'm wondering if it can be done.
NOTE: I know I can encode the content of <PersonXml> escaping illegal XML chars, but I would prefer to leave the inner XML more human friendly (not containing < and other entities that will only cofuse my end user)