With Jeff Beck's help on the XSLT, I went ahead and implemented this in our DtdAnalyzer. For the record, in case anyone else is interested, it is here:
http://dtd.nlm.nih.gov/ncbi/dtdanalyzer/. The new utility is called "dtdflatten".
One known limitation is that it does not preserve any NOTATION declarations.
John, I had a look at your DTDCrunch, and yes, I think that's more than we want -- I definitely want to preserve the ability to validate against the flattened DTD. Also, it looks like maybe you have an escaping problem. In xhtml1-crunched.dtd, you have
<!ENTITY quot """ >
You need to escape the quote mark. We ran into this same problem in our first iteration.
Cheers!
Chris Maloney