AbstractXmlRule extends AbstractRule implements ImmutableLanguage { protected void visit(XmlNode node, RuleContext ctx) { final int numChildren = node.getNumChildren(); for (int i = 0; i < numChildren; i++) { XmlNode child = (XmlNode) node.getChild(i); visit(child, ctx); } } AbstractXmlRule(); protected  AbstractXmlRule(Language language); @Override ParserOptions getParserOptions(); @Override void apply(List<? extends Node> nodes, RuleContext ctx); @Deprecated
    static final BooleanProperty COALESCING_DESCRIPTOR; @Deprecated
    static final BooleanProperty EXPAND_ENTITY_REFERENCES_DESCRIPTOR; @Deprecated
    static final BooleanProperty IGNORING_COMMENTS_DESCRIPTOR; @Deprecated
    static final BooleanProperty IGNORING_ELEMENT_CONTENT_WHITESPACE_DESCRIPTOR; @Deprecated
    static final BooleanProperty NAMESPACE_AWARE_DESCRIPTOR; @Deprecated
    static final BooleanProperty VALIDATING_DESCRIPTOR; @Deprecated
    static final BooleanProperty XINCLUDE_AWARE_DESCRIPTOR; }
@Test public void testVisit() throws Exception { String source = "<?xml version=\"1.0\"?><foo abc=\"abc\"><bar/></foo>"; XmlParserOptions parserOptions = new XmlParserOptions(); Parser parser = LanguageRegistry.getLanguage(XmlLanguageModule.NAME).getDefaultVersion() .getLanguageVersionHandler().getParser(parserOptions); XmlNode xmlNode = (XmlNode) parser.parse(null, new StringReader(source)); List<XmlNode> nodes = new ArrayList<>(); nodes.add(xmlNode); MyRule rule = new MyRule(); rule.apply(nodes, null); assertEquals(3, rule.visitedNodes.size()); assertEquals("document", rule.visitedNodes.get(0).toString()); assertEquals("foo", rule.visitedNodes.get(1).toString()); assertEquals("bar", rule.visitedNodes.get(2).toString()); }