Serialization Exception

I am using this SAMLAttribute attr1 = new SAMLAttribute(xmlElement);
but i am getting follow error

Message=The XML is not an attribute.

The expectation is that the XmlElement parameter to the constructor has the name “Attribute” and is declared in the “urn:oasis:names:tc:SAML:2.0:assertion” namespace.

If there’s still an issue, please send the XML (ie the xmlElement.OutXml string) to so we can take a look.