When overridden in a derived class, reconstructs a security object with a specified state from an XML encoding.
Type Reason ArgumentException elem does not contain the XML encoding for a instance of the same type as the current instance.
-or-
The version number of elem is not valid.
Custom code that extends security objects needs to implement the CodeAccessPermission.ToXml and CodeAccessPermission.FromXml(SecurityElement) methods to make the objects security-encodable.