void sendPublishedItems(IQ originalRequest, List<PublishedItem> publishedItems) {
        Log.trace("Sending {} published item(s) in response to request from '{}'", publishedItems.size(), originalRequest.getFrom());
        IQ result = IQ.createResultIQ(originalRequest);
        Element pubsubElem = result.setChildElement("pubsub", "http://jabber.org/protocol/pubsub");
        Element items = pubsubElem.addElement("items");
        items.addAttribute("node", nodeID);
        
        for (PublishedItem publishedItem : publishedItems) {
            Element item = items.addElement("item");
            if (isItemRequired()) {
                item.addAttribute("id", publishedItem.getID());
            }
            item.add(publishedItem.getPayload().createCopy());
        }
        // Send the result
        getService().send(result);
    }
Sends an IQ result with the list of items published to the node. Item ID and payload are always included.
Should only be used for use-cases described in section "6.5 Retrieve Items from a Node" from XEP-0060 (as
opposed to processing of notifications or service discovery, which are allowed to discard payloads).

@param originalRequest the IQ packet sent by a subscriber (or anyone) to get the node items.
@param publishedItems the list of published items to send to the subscriber.
xmppserver/src/main/java/org/jivesoftware/openfire/pubsub/LeafNode.java