# shouldEncryptElement method

1. @visibleForOverriding

bool shouldEncryptElement(

1. XMLNode element

)

Determines what child elements of a stanza should be encrypted. If shouldEncrypt returns true for `element`, then `element` will be encrypted. If shouldEncrypt returns false, then `element` won't be encrypted.

The default implementation ignores all elements that are mentioned in XEP-0420, i.e.:

- XEP-0033 elements (<addresses>)</addresses>
- XEP-0334 elements (<store>, , , )</store>
- XEP-0359 elements (, )

## Implementation

    @visibleForOverriding
    bool shouldEncryptElement(XMLNode element) {
      for (final ignore in _doNotEncryptList) {
        final xmlns = element.attributes['xmlns'] ?? '';
        if (element.tag == ignore.tag && xmlns == ignore.xmlns) {
          return false;
        }
      }

      return true;
    }