getSelectedElements = function (rootElm, startNode, endNode) {
		var walker, node, elms = [];

		walker = new TreeWalker(startNode, rootElm);
		for (node = startNode; node; node = walker.next()) {
			if (node.nodeType === 1) {
				elms.push(node);
			}

			if (node === endNode) {
				break;
			}
		}

		return elms;
	}
Unlink implementation that doesn't leave partial links for example it would produce:
 a[b<a href="x">c]d</a>e -> a[bc]de
instead of:
 a[b<a href="x">c]d</a>e -> a[bc]<a href="x">d</a>e