* @return the list of subscriptions or an empty list.
*/
private List<SubscriptionItem> collectSubscriptions(CollectionNode root, Entity sender, String nodeName) {
List<SubscriptionItem> subscriptions;
if (nodeName == null) { // all subscriptions for all nodes
NodeSubscriberVisitor nodeSubscriptionVisitor = new NodeSubscriberVisitor(sender);
root.acceptNodes(nodeSubscriptionVisitor);
subscriptions = nodeSubscriptionVisitor.getSubscriptions();
} else { // only the subscriptions for the requested node
LeafNode node = root.find(nodeName);
if (node == null) {
// done - this is only a filter - no error conditions are defined