Apple interview question

Write a program to go through a DOM tree