I have defined the following class:
public class Root
{
public string Name;
public string XmlString;
}
and created an object:
I would be very surprised if this was possible. Suppose it was possible for you to do this - what would happen if you had malformed XML in the property - everything would just break.
I expect that you will either need to write your own serialization for this case, or make it so that the XmlString field is a structure that contains a foo field.