modified for generatng DTD format