void (final Visitor visitor) { acceptChildren(new DomElementVisitor() { @Override public void visitDomElement(DomElement element) { if (element instanceof CommonElement) { ((CommonElement<?>)element).accept(visitor); } } }); }