未经测试,但我相信你想要:
[XmlElement(nameof(Space), typeof(Space))] [XmlElement(nameof(Device), typeof(Device))] public List<DesignElement> children { get; set; } // or elements