recursive version which traverses all textNodes