Consider the following two program fragments. The first one eliminates all attributes from elements. For example: is translated to: The second one eliminates name space references (NSRef-objects) from complex types. For example: is translated to: System.out.println(" Eliminate attributes from elements "); cg2.traverse(s,"from Schema to Element", new Visitor() { void before(Element host){ System.out.println(" Element found "); host.set_attrs(new AttrValue_List()); } }); System.out.println("========"); System.out.println(" Eliminate name space refs from complex types "); cg2.traverse(s,"from Schema to ComplexType", new Visitor() { void before(ComplexType host){ System.out.println(" ComplexType found "); host.set_prefixS(null); } });