If I have to create an empty DOM, I must read the DTD and create empty DOM.
You are working with some realllly bad assumptions there. A DTD is NOT sufficient to create a DOM - take a look at the DTD for HTML for example. A DTD constrains the structure of a XML document but thats about all you can say.
How much have you done to relate the values in the CSV to the elements in the DOM? For each item in the DTD, do you know which is the corresponding CSV value?
It sounds like you want a DOM with a root element that contains repeating elements, one for each line. Each line element will contain all the CSV data from one line as elements or attributes according to the DTD.
Converting various text formats to XML is a common problem. You may be able to use one of the existing toolkits
discussed in my article on XML pipelines. I would suggest looking at the ServingXML toolkit first.
Bill