This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Move lines 13-15 to before the loop; they are called for the node itself, not the child nodes.
Be warned though that the cast to Element may fail; whitespace like line breaks are often seen as Text nodes, and will show up in the child node list.