public void WriteMembers(object instance, ISerialiserNode parentNode, Type type) { var typeName = typeNamesCache.GetTypeName(type); using ( var baseClassNode = ownerDocument.CreateBaseClassElement(typeName, parentNode)) { using (var membersNode = ownerDocument.CreateMembersElement(baseClassNode)) { memberWriter.Write(instance, membersNode, type); } baseTypeMembersWriter.WriteMembers(instance, baseClassNode, type); } }