Then it is much worse...
I suspected that there is no way to do so, because DTD's do not use XML syntax and are not parsed by the parser. When XSLT processor receives an input tree built by the parser, DTD's declarations are already applied and forgotten. I asked your question "if there is any way to copy DOCTYPE declaration" in
another forum and here is what
guru said:
"No, there isn't. The DOCTYPE declaration isn't part of the tree model built by the parser."
As I can imagine, all possible workarounds are outside of XSLT. You can read your XML as a text file in
Java program, for example, save DOCTYPE declaration in a
string, then call XSLT transformation, save its result in another string and then combine them. If anybody has better ideas, please, post them here!