[New] Using visitor pattern to perform DOM actions