Sandeep,
Its not recommended to use that approach as you wont be able to use the created Document to visually manage any mappings. But if you are sure of your use case and really want this you have to make sure you use org.w3c.dom.Document and not com.wm.lang.xml.Document. You can do that by fixing you import statements in the code or specifically fixing the class name as such:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db;
db = dbf.newDocumentBuilder();
org.w3c.dom.Document doc = db.parse( new FileInputStream(new File(“D:\flow.xml”)));
Rupinder Singh
#webMethods#Integration-Server-and-ESB#Flow-and-Java-services