code: private static Stream<Node> streamChildNodes(Node node) {
          int children = node.getChildNodes().getLength();
          Node firstChild = node.getFirstChild();
          if (firstChild == null) return Stream.empty();
          return Stream.iterate(firstChild, prev -> prev != null ? prev.getNextSibling() : null)
              .limit(children)
              .filter(n -> n != null);
      }
docs: Needs to be thread-safe, childNodes NodeList is not!