if (element.getObject() != VISITED) {
// Log the entire dom and current element every time through here.
// This makes it *much* easier to find bugs in here.
if (logger.isDebugEnabled()) {
DebugDocument debug = new DebugDocument();
if (document != null) {
logger.debug("ENTIRE DOM:\n" + debug.debug(document));
}
logger.debug("THIS ELEMENT:\n" + debug.debug(element));
}
// We mark this element as visited so that we know not to re-visit
// it later if the DOM tree changes considerably and causes the
// traversal to backtrack on itself.