Transforming a user-supplied DTD satisfying a first XML grammar into a
PDTD satisfying a second XML grammar, including converting DTD
declarations of alternate content to sequences, converting DTD
declarations of optional content to mandatory content, converting DTD
declarations of imbedded sequences to subsequences, and demoting
attribute definitions of DTD elements having attributes to children of
the DTD elements having attributes. Embodiments include converting
recursions into repetitions, demoting imbedded compound repetitions from
element declarations having imbedded compound repetitions, and demoting
imbedded leaves from elements having imbedded leaves.