private void modifyNodeSubscriptions(PubSubService service, IQ iq, Element entitiesElement) {
        String nodeID = entitiesElement.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 getting affiliates list. Return forbidden error.
            sendErrorPacket(iq, PacketError.Condition.forbidden, null);
            return;
        }

        IQ reply = IQ.createResultIQ(iq);

        // Process modifications or creations of affiliations and subscriptions.
        for (Iterator<Element> it = entitiesElement.elementIterator("subscription"); it.hasNext();) {
            Element entity = it.next();
            JID subscriber = new JID(entity.attributeValue("jid"));
            // TODO Assumed that the owner of the subscription is the bare JID of the subscription JID. Waiting StPeter answer for explicit field.
            JID owner = subscriber.asBareJID();
            String subStatus = entity.attributeValue("subscription");
            String subID = entity.attributeValue("subid");
            // Process subscriptions changes
            // Get current subscription (if any)
            NodeSubscription subscription = null;
            if (node.isMultipleSubscriptionsEnabled()) {
                if (subID != null) {
                    subscription = node.getSubscription(subID);
                }
            }
            else {
                subscription = node.getSubscription(subscriber);
            }
            if ("none".equals(subStatus) && subscription != null) {
                // Owner is cancelling an existing subscription
                node.cancelSubscription(subscription);
            }
            else if ("subscribed".equals(subStatus)) {
                if (subscription != null) {
                    // Owner is approving a subscription (i.e. making active)
                    node.approveSubscription(subscription, true);
                }
                else {
                    // Owner is creating a subscription for an entity to the node
                    node.createSubscription(null, owner, subscriber, false, null);
                }
            }
        }

        // Send reply
        router.route(reply);
    }
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