What's in Java 17 for XML Developers

Java 17 brings pattern switches one step closer to finalization.  You can use types and have guard clauses on them: which makes the Java swtich a little more like

For XML developers, I expect the main use is to make neater dispatch code for dispatching on DOM Nodes, such as wen tree-walking DOMs.  Something like this:

static void dispatch(Node o) {
    switch (o) {
        case null                      -> throw new NullPointerException();
        case Element e  && count < 46  -> handleElement(e);
        case Element e  && count >= 46 -> handleExcessiveElement(e);
        case Comment c  -> handleComment(c);
        default  -> handleEverythingElse(o);
    }
}