[Serializable] public class Employee { public string Name { get; set; } public int Age { get; set; } public Department Department { get; set; } public Employee(string name, int age, Department department) { Name = name; Age = age; Department = department; } public void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("Name", Name); info.AddValue("Age", Age); info.AddChild("Department", typeof(Department), Department); } } [Serializable] public class Department { public string Name { get; set; } public ListIn the above code example, the Employee and Department classes are marked with the [Serializable] attribute so that they can be serialized. Both classes implement the GetObjectData method which is called during serialization. The Employee class uses SerializationInfo.AddChild method to add the Department object as a child to its own serialization data. The Department class uses SerializationInfo.AddChild method to add the Employees list as a child to its own serialization data. The package library for SerializationInfo.AddChild method is the System.Runtime.Serialization assembly.Employees { get; set; } public Department(string name, List employees) { Name = name; Employees = employees; } public void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("Name", Name); info.AddChild("Employees", typeof(List ), Employees); } }