def validate_num_assertions(self):
encrypted_assertion_nodes = OneLogin_Saml2_Utils.query(self.document, '<STR_LIT>')<EOL>assertion_nodes = OneLogin_Saml2_Utils.query(self.document, '<STR_LIT>')<EOL>valid = len(encrypted_assertion_nodes) + len(assertion_nodes) == <NUM_LIT:1><EOL>if (self.encrypted):<EOL><INDENT>assertion_nodes = OneLogin_Saml2_Utils.query(self.decrypted_document, '<STR_LIT>')<EOL>valid = valid and len(assertion_nodes) == <NUM_LIT:1><EOL><DEDENT>return valid<EOL>
Verifies that the document only contains a single Assertion (encrypted or not)

:returns: True if only 1 assertion encrypted or not
:rtype: bool