public void delete() {
        getLogger().trace("Delete node from the database...");
        XMPPServer.getInstance().getPubSubModule().getPersistenceProvider().removeNode(this);
        if (parentIdentifier != null) {
            getLogger().trace("Remove this node from the parent node {}", parentIdentifier);
            final CollectionNode parent = getParent();
            // Notify the parent that the node has been removed from the parent node
            if (isNotifiedOfDelete()){
                parent.childNodeDeleted(this);
            }
            parent.removeChildNode(this);
        }
        deletingNode();

        if (isNotifiedOfDelete()) {
            getLogger().trace("Broadcast delete notification to subscribers...");

            // Build packet to broadcast to subscribers
            Message message = new Message();
            Element event = message.addChildElement("event", "http://jabber.org/protocol/pubsub#event");
            Element items = event.addElement("delete");
            items.addAttribute("node", nodeID);
            // Send notification that the node was deleted
            broadcastNodeEvent(message, true);
        }
        // Remove presence subscription when node was deleted.
        cancelPresenceSubscriptions();
        // Remove the node from memory
        getService().removeNode(nodeID);
        CacheFactory.doClusterTask(new RemoveNodeTask(this));
        // Clear collections in memory (clear them after broadcast was sent)
        affiliates.clear();
        subscriptionsByID.clear();
        subscriptionsByJID.clear();
    }
Deletes this node from memory and the database. Subscribers are going to be notified
that the node has been deleted after the node was successfully deleted.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/Node.java