code: def decrypt_element(encrypted_data, key, debug=False, inplace=False):
          
  
          if isinstance(encrypted_data, Element):
              encrypted_data = OneLogin_Saml2_XML.to_etree(str(encrypted_data.toxml()))
          if not inplace and isinstance(encrypted_data, OneLogin_Saml2_XML._element_class):
              encrypted_data = deepcopy(encrypted_data)
          elif isinstance(encrypted_data, OneLogin_Saml2_XML._text_class):
              encrypted_data = OneLogin_Saml2_XML._parse_etree(encrypted_data)
  
          xmlsec.enable_debug_trace(debug)
          manager = xmlsec.KeysManager()
  
          manager.add_key(xmlsec.Key.from_memory(key, xmlsec.KeyFormat.PEM, None))
          enc_ctx = xmlsec.EncryptionContext(manager)
          return enc_ctx.decrypt(encrypted_data)
docs: Decrypts an encrypted element.
  
          :param encrypted_data: The encrypted data.
          :type: lxml.etree.Element | DOMElement | basestring
  
          :param key: The key.
          :type: string
  
          :param debug: Activate the xmlsec debug
          :type: bool
  
          :param inplace: update passed data with decrypted result
          :type: bool
  
          :returns: The decrypted element.
          :rtype: lxml.etree.Element