}
}
private static void print(Element e, int depth) {
do {
ElementTraversal et = (ElementTraversal) e;
for (int i = 0; i < depth; ++i) {
System.out.print("--");
}
System.out.print("--> [");
System.out.print(new QName(e.getNamespaceURI(), e.getLocalName()));
System.out.println("], Child Element Count = " + et.getChildElementCount());
Element firstElementChild = et.getFirstElementChild();
if (firstElementChild != null) {
print(firstElementChild, depth + 1);
}
e = et.getNextElementSibling();
}
while (e != null);
}