private void purgeNode(PubSubService service, IQ iq, Element purgeElement) {
        String nodeID = purgeElement.attributeValue("node");
        if (nodeID == null) {
            // NodeID was not provided. Return bad-request error
            sendErrorPacket(iq, PacketError.Condition.bad_request, null);
            return;
        }
        Node node = service.getNode(nodeID);
        if (node == null) {
            // Node does not exist. Return item-not-found error
            sendErrorPacket(iq, PacketError.Condition.item_not_found, null);
            return;
        }
        if (!node.isAdmin(iq.getFrom())) {
            // Requesting entity is prohibited from configuring this node. Return forbidden error
            sendErrorPacket(iq, PacketError.Condition.forbidden, null);
            return;
        }
        if (!((LeafNode) node).isPersistPublishedItems()) {
            // Node does not persist items. Return feature-not-implemented error
            Element pubsubError = DocumentHelper.createElement(
                    QName.get("unsupported", "http://jabber.org/protocol/pubsub#errors"));
            pubsubError.addAttribute("feature", "persistent-items");
            sendErrorPacket(iq, PacketError.Condition.feature_not_implemented, pubsubError);
            return;
        }
        if (node.isCollectionNode()) {
            // Node is a collection node. Return feature-not-implemented error
            Element pubsubError = DocumentHelper.createElement(
                    QName.get("unsupported", "http://jabber.org/protocol/pubsub#errors"));
            pubsubError.addAttribute("feature", "purge-nodes");
            sendErrorPacket(iq, PacketError.Condition.feature_not_implemented, pubsubError);
            return;
        }

        // Purge the node
        ((LeafNode) node).purge();
        // Return that node purged successfully
        router.route(IQ.createResultIQ(iq));
    }
Checks if the following conditions are satisfied and creates a node
- Requester can create nodes
- Instant node creation is enabled
- Node does not already exist
- New node configuration is valid

<br>NOTE 1: This method should not reply to the client
<br>NOTE 2: This method calls UserManager::isRegisteredUser(JID) which can block waiting for a response - so
do not call this method in the same thread in which a response might arrive

@param service The service instance that's responsible for processing (cannot be null)
@param requester The (full) JID of the entity that performs the action (cannot be null)
@param configuration Optional Configuration dataform, if user requested to configure the node (can be null)
@param nodeID The ID of the node to be created, or null when an instant node is to be created.
@param publishOptions Optional Publishing Options, which are either preconditions or configuration overrides (can be null)
@return {@link CreateNodeResponse}
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/PubSubEngine.java