To work around the problem, try this XmlSerializer:
XmlAttributeOverrides ao = new XmlAttributeOverrides( );
XmlAttributes a = new XmlAttributes { XmlIgnore = true };
ao.Add( typeof( Rectangle ), nameof( Rectangle.Location ), a );
ao.Add( typeof( Rectangle ), nameof( Rectangle.Size ), a );
XmlSerializer s = new XmlSerializer( typeof( MyClass ), ao );
Use your class instead of MyClass.