Assuming my xml is as :
<body>Don't forget me this weekend!</body>
<body>I will not</body>
I would like to create dtd/schema for that. Also would like to validate that xml using DOM. Please suggest
Validation implies the presence of some form of schema (DTD, XSD, Relax-NG). But it sounds as if you want to check whether an XML document is wellformed instead. Simply parse the XML and see if an exception happens.