While working on another feature, I noticed that the document toggle wasn't updating the ToC. I fixed that. (It matters only in the case where entire headings are toggled, but we do have one such case.)
I made a new implementation of the XML/Java toggle (and added a third choice for having both available).
Changes to make a dynamic ToC work with content selection toggles
Various asciidoc and JavaScript changes to make the dynamic ToC (tocbot) work with the content toggle (XML or Java in this case but also more options in other projects).