There are tools for automatic DTD generation, check
http://www.xmlsoftware.com/ for example.
Regarding Sreeni's example: there are (very limited) features for conditional processing in DTD - INCLUDE and IGNORE declaration, but they do not provide for varying processing depending on run-time information. And I suspect this is what you want. What are your (child1) and (child2) conditions anyway?
You can make both documents valid by writing something like
<!ELEMENT parent (child1 | child2)
but I guess this is not enough for your requirements. If you want some of your documents to valid or invalid depending on some data in this document, then it cannot be done with DTD in general sense. But there may be some workarounds, like to add "wrapping" elements to your documents (if have control on how they are generated), like
<!ELEMENT parent (parent1 | parent2)>
<!ELEMENT parent1 (child1)>
<!ELEMENT parent2 (child2)>
[This message has been edited by Mapraputa Is (edited September 17, 2001).]