# File lib/xml/dom2/node.rb, line 340 def _insertNodes(index, node) if node.nodeType == DOCUMENT_FRAGMENT_NODE node.childNodes.to_a.each_with_index do |n, i| if index == -1 _insertNodes(-1, n) else _insertNodes(index + i, n) end end elsif node.is_a?(Node) ## to be checked _checkNode(node) node._removeFromTree if index == -1 @children.push(node) else @children[index, 0] = node end node.parentNode = self else raise ArgumentError, "invalid value for Node" end end