When overridden in a derived class, creates an XML encoding of the security object and its current state.
![]()
An XML encoding of the security object, including any state information.
Custom code that extends security objects needs to implement the CodeAccessPermission.ToXml and CodeAccessPermission.FromXml(SecurityElement) methods to make the objects security-encodable.