docs: static void applyOrdering(
              List<NodeInfo> order,
              Element compViewParent,
              Element positionSet,
              NodeInfoTracker tracker) {
  
          // first pull out all visible channel or visible folder children and
          // put their id's in a list of available children and record their
          // relative order in the CVP.
  
          final Map<String, NodeInfo> available = new LinkedHashMap<String, NodeInfo>();
  
          Element child = (Element) compViewParent.getFirstChild();
          Element next = null;
          int indexInCVP = 0;
  
          while (child != null) {
              next = (Element) child.getNextSibling();
  
              if (child.getAttribute("hidden").equals("false")
                      && (!child.getAttribute("chanID").equals("")
                              || child.getAttribute("type").equals("regular"))) {
                  final NodeInfo nodeInfo = new NodeInfo(child, indexInCVP++);
  
                  tracker.track(order, compViewParent, positionSet);
  
                  final NodeInfo prevNode = available.put(nodeInfo.getId(), nodeInfo);
                  if (prevNode != null) {
                      throw new IllegalStateException(
                              "Infinite loop detected in layout. Triggered by "
                                      + nodeInfo.getId()
                                      + " with already visited node ids: "
                                      + available.keySet());
                  }
              }
              child = next;
          }
  
          // now fill the order list using id's from the position set if nodes
          // having those ids exist in the composite view. Otherwise discard
          // that position directive. As they are added to the list remove them
          // from the available nodes in the parent.
  
          Document CV = compViewParent.getOwnerDocument();
          Element directive = (Element) positionSet.getFirstChild();
  
          while (directive != null) {
              next = (Element) directive.getNextSibling();
  
              // id of child to move is in the name attrib on the position nodes
              String id = directive.getAttribute("name");
              child = CV.getElementById(id);
  
              if (child != null) {
                  // look for the NodeInfo for this node in the available
                  // nodes and if found use that one. Otherwise use a new that
                  // does not include an index in the CVP parent. In either case
                  // indicate the position directive responsible for placing this
                  // NodeInfo object in the list.
  
                  final String childId = child.getAttribute(Constants.ATT_ID);
                  NodeInfo ni = available.remove(childId);
                  if (ni == null) {
                      ni = new NodeInfo(child);
                      tracker.track(order, compViewParent, positionSet);
                  }
  
                  ni.setPositionDirective(directive);
                  order.add(ni);
              }
              directive = next;
          }
  
          // now append any remaining ids from the available list maintaining
          // the order that they have there.
  
          order.addAll(available.values());
      }