Missing tag in an XML prevents a XmlSerializer to create a property
===

I have a problem when using the XmlSerializer class.

I have an object like that :

    public class Test
    {
      [XmlElement("data")]
      public AnotherObject Data
      {
        get; set;
      }
      
      // other properties
    }
    
It will work properly when I will try to deserialize that :

    <Test>
      <data>...</data>
      <something else... />
    </Test>
    
However, if the xml is like :

    <Test>
      <something else... />   
    </Test>
    
When I will try to read the Data property of the newly created object, the code will throw an exception. If I try to observe the object, the debugger prints a "Could not evaluate exception".

I want the property to exist, even if there is no corresponding tag in the XML.

Is it possible to do that ?

Thanks !