private void updateList(Element listElement, boolean notify) {
        // Reset the list of items of this list
        items = new ArrayList<>();

        List<Element> itemsElements = listElement.elements("item");
        for (Element itemElement : itemsElements) {
            PrivacyItem newItem = new PrivacyItem(itemElement);
            items.add(newItem);
            // If the user's roster is required to evaluation whether a packet must be blocked
            // then ensure that the roster is available
            if (newItem.isRosterRequired()) {
                Roster roster = getRoster();
                if (roster == null) {
                    Log.warn("Privacy item removed since roster of user was not found: " + userJID.getNode());
                    items.remove(newItem);
                }
            }
        }
        // Sort items collections
        Collections.sort(items);
        if (notify) {
            // Trigger event that this list has been modified
            PrivacyListManager.getInstance().dispatchModifiedEvent(this);
        }
    }
Sets the new list items based on the specified Element. The Element must contain
a list of item elements.

@param listElement the element containing a list of items.
@param notify true if a provicy list modified event will be triggered.
xmppserver/src/main/java/org/jivesoftware/openfire/privacy/PrivacyList.java