Preserve whitespace-only element content when deserializing XML using XmlSerializer
问题 I have a class InputConfig which contains a List<IncludeExcludeRule> : public class InputConfig { // The rest of the class omitted private List<IncludeExcludeRule> includeExcludeRules; public List<IncludeExcludeRule> IncludeExcludeRules { get { return includeExcludeRules; } set { includeExcludeRules = value; } } } public class IncludeExcludeRule { // Other members omitted private int idx; private string function; public int Idx { get { return idx; } set { idx = value; } } public string