DomTool is implemented mostly in Standard ML(SML), with teeny tiny bits of C and shell script. Standard ML is a statically typed functional programming language with much to recommend it, including a language standard (with formal semantics), one of the best open source optimizing compilers ever for any language, and open development models and communities associated with the major implementations (out of about 10 total language implementations floating around today).
But really, why choose a programming language that "nobody's ever heard of"? The answer is simple. With SML, you can program at a high level of abstraction without having to worry about performance penalties and other historical undesirables.
In the following sections, I'll often refer to SML modules by name, instead of giving source file paths. A module named Name will be defined in either domtool2/name.sml or domtool2/plugins/name.sml, depending on whether it's part of core DomTool or of a plugin. You'll also find signature NAME defined in domtool2/name.sig or domtool2/plugins/name.sig. I readily point the reader to the source code itself, and the signature files in particular, as the best sources of detailed documentation on the implementation. Readers coming from backgrounds outside of statically-typed functional programming may be pleasantly surprised at how well ML code documents itself!