public Element asElement() {
        //Element listElement = DocumentFactory.getInstance().createDocument().addElement("list");
        Element listElement = DocumentFactory.getInstance().createDocument()
                .addElement("list", "jabber:iq:privacy");
        listElement.addAttribute("name", getName());
        // Add the list items to the result
        for (PrivacyItem item : items) {
            listElement.add(item.asElement());
        }
        return listElement;
    }
Returns an Element with the privacy list XML representation.

@return an Element with the privacy list XML representation.
xmppserver/src/main/java/org/jivesoftware/openfire/privacy/PrivacyList.java