private IQ getPrivacyListsNames(IQ packet, JID from) {
        IQ result = IQ.createResultIQ(packet);
        Element childElement = packet.getChildElement().createCopy();
        result.setChildElement(childElement);
        Map<String, Boolean> privacyLists = provider.getPrivacyLists(from.getNode());
        // Add the default list
        for (String listName : privacyLists.keySet()) {
            if (privacyLists.get(listName)) {
                childElement.addElement("default").addAttribute("name", listName);
            }
        }
        // Add the active list (only if there is an active list for the session)
        ClientSession session = sessionManager.getSession(from);
        if  (session != null && session.getActiveList() != null) {
            childElement.addElement("active")
                    .addAttribute("name", session.getActiveList().getName());
        }

        // Add a list element for each privacy list
        for (String listName : privacyLists.keySet()) {
            childElement.addElement("list").addAttribute("name", listName);
        }
        return result;
    }
Returns the IQ packet containing the active and default lists and the lists
defined by the user.

@param packet IQ packet requesting the lists.
@param from sender of the IQ packet.
@return the IQ packet containing the active and default lists and the lists
        defined by the user.
xmppserver/src/main/java/org/jivesoftware/openfire/handler/IQPrivacyHandler.java