DTD dtd = new DTDParser(resource).parse();
Element rootElement = fromWutka(dtd.rootElement);
DocumentDefinition definition = new DocumentDefinition(resource, rootElement);
@SuppressWarnings("unchecked")
Enumeration<DTDElement> elements = dtd.elements.elements();
while(elements.hasMoreElements()) {
DTDElement element = elements.nextElement();
definition.addElement(fromWutka(element));
}
return definition;
}