public static Node[] findNodesOf(NodeList list, String tagName, boolean caseSensitive) {
		ArrayList<Node> result = new ArrayList<Node>();
		for (int i = 0; i < list.getLength(); i++) {
			Node node = list.item(i);
			if (node instanceof Element) {
				Element nodeAsElement = (Element) node;
				if ((caseSensitive && nodeAsElement.getNodeName().equals(tagName))
						|| (!caseSensitive && nodeAsElement.getNodeName().equalsIgnoreCase(tagName)))
					result.add(node);
			}
		}
		return result.toArray(new Node[0]);
	}