You can do that another way. This is one thing I feel very strongly about. This is not a style question, but rather a very fundamental one. You can't write good code against a NodeList.