I am in the process of changing a dom4j implementation to a the w3c dom. I am not able to find many of the equivalent calls.
for example, there is a case when I want to take a html fragment which starts with a <div>, and add the surrounding html tags, starting with <html><head></head><body>......</body></html>.
I can create new tags with Document.createElement(name), but I don't see any way to set the new <html> tag as the root element, nor any way to change the parent node of the <div> tag. In fact, it would be nice if I can change the <div> tag to a <body> tag. but I don't see any api to change tag name either.
How are you suppose to accomplish the adding of surrounding tags to an existing html fragment using w3c dom?