Walking the node tree

Test elements

A div
Div X
Div Y with a B
A div
A div
Div Z with an I

I remove all empty text nodes from the test DIVs.

Test scripts

.