See BasicTransformer.java, which overrides this method. In order for that code to work it's necessary to throw the checked exception TransformerException, which BasicVisitor should not throw (and I suspect CopyOnWriteTransformer should not either, but we'll see about that later).