code: static final boolean textNodesOnly(NodeList list) {
          final int length = list.getLength();
  
          for (int i = 0; i < length; i++)
              if (list.item(i).getNodeType() != Node.TEXT_NODE)
                  return false;
  
          return true;
      }
docs: Check whether there are any element nodes in a {@link NodeList}