Pregunta de entrevista de Apple

Write a program to go through a DOM tree