Convert a {@link NodeList} to a Java {@link List} of {@link Element}s.
@param _nodeList collection of nodes
@return list of elements
342778
public static List<Element> convertToElementList(org.w3c.dom.NodeList _nodeList) {
        List<org.w3c.dom.Element> elemList = new ArrayList<>();
        for (int i = 0; i < _nodeList.getLength(); i++) {
            Element elem = (org.w3c.dom.Element) _nodeList.item(i);
            elemList.add(elem);
        }
        return elemList;
    }
298508
protected function childrenAsArray($nodeList)
	{
		$result = array();
		if (! is_object($nodeList))
		{
			return $result;
		}

		if (! ($nodeList instanceof DOMNodeList))
		{
			return $result;
		}

		for ($i = 0; $i < $nodeList->length; $i++)
		{
			$result []= $nodeList->item($i);
		}

		return $result;
	}
1043589
protected static <T> List<T> toList(JSONArray jsonArray, Class<T> elementType) {
		return Convert.toList(elementType, jsonArray);
	}
1059474
public static List<CSNodeWrapper> getAllChildrenNodes(final CSNodeWrapper csNode) {
        final List<CSNodeWrapper> nodes = new LinkedList<CSNodeWrapper>();
        if (csNode.getChildren() != null) {
            final List<CSNodeWrapper> childrenNodes = csNode.getChildren().getItems();
            for (final CSNodeWrapper childNode : childrenNodes) {
                nodes.add(childNode);
                nodes.addAll(getAllChildrenNodes(childNode));
            }
        }

        return nodes;
    }
761739
public static <T extends Node> List<T> findNodes(List<Node> nodes, Class<T> cls) {
        List<T> results = new ArrayList<>();
        findNodes(nodes, cls, results);
        return results;
    }
114743
public List<Node> siblingNodes() {
        if (parentNode == null)
            return Collections.emptyList();

        List<Node> nodes = parentNode.ensureChildNodes();
        List<Node> siblings = new ArrayList<>(nodes.size() - 1);
        for (Node node: nodes)
            if (node != this)
                siblings.add(node);
        return siblings;
    }
359721
public static List<Object> getChildren(TreeModel treeModel, Object node)
    {
        List<Object> children = new ArrayList<Object>();
        int n = treeModel.getChildCount(node);
        for (int i=0; i<n; i++)
        {
            Object child = treeModel.getChild(node, i);
            children.add(child);
        }
        return children;
    }
574784
<T extends Node> NodeList<T> add(NodeList<T> list, T obj) {
        if (list == null) {
            list = new NodeList<>();
        }
        list.add(obj);
        return list;
    }
905213
public NodeList nodelist() throws javax.xml.transform.TransformerException
  {
    return (m_origObj instanceof NodeList) 
                   ? (NodeList)m_origObj : super.nodelist();      
  }
1183707
static List<Node> nodeList2List(NodeList nl) {
        int len = nl.getLength();
        List<Node> l = new ArrayList<Node>(len);
        for (int i = 0; i < len; i++) {
            Node n = nl.item(i);
            if (!XMLUnit.getIgnoreComments() || !(n instanceof Comment)) {
                l.add(n);
            }
        }
        return l;
    }
42216
public static <E> ArrayList<E> newArrayList(Iterable<? extends E> elements) {
		return (elements instanceof Collection) ? new ArrayList<E>((Collection<? extends E>)elements)
				: newArrayList(elements.iterator());
	}
622058
public static <T> LinkedList<T> newLinkedList(Iterable<? extends T> elements) {
		return Lists.newLinkedList(elements);
	}
820567
private ArrayList<E> toArrayList() {
        ArrayList<E> list = new ArrayList<>();
        for (Node<E> p = first(); p != null; p = succ(p)) {
            E item = p.item;
            if (item != null)
                list.add(item);
        }
        return list;
    }
1151840
public JcCollection<JcNode> nodes() {
		return new JcCollection<JcNode>(null, this,
				new FunctionInstance(FUNCTION.Path.NODES, 1), JcNode.class);
	}
1102365
private function convertNodeListToArray(DOMNodeList $nodeList)
    {
      $array = array();

      if(!is_null($nodeList) && $nodeList->length > 0)
      {
         foreach($nodeList as $node)
           array_push($array, $node);
      }

      return $array;
    }
709111
@NotNull
    public static List<String> toList(@Nullable final String stringList, @NotNull final String delimiter) {
        return new ArrayList<>(Arrays.asList(toArray(stringList, delimiter)));
    }
1228190
public static NodeList toNodeList(Object o) throws PageException {
	// print.ln("nodeList:"+o);
	if (o instanceof NodeList) {
	    return (NodeList) o;
	}
	else if (o instanceof ObjectWrap) {
	    return toNodeList(((ObjectWrap) o).getEmbededObject());
	}
	throw new CasterException(o, "NodeList");
    }