(Element)DocumentHelper.parseText(xml).getRootElement().detach() As a forewarning, I think this creates the element in the null namespace. If you need it in the xhtml namespace, you may have to do a little more work. --Evan
----- Original Message ----- From: Devang Joshi <[EMAIL PROTECTED]> Date: Monday, March 12, 2007 4:44 pm Subject: [dom4j-user] convert String to Element To: dom4j-user@lists.sourceforge.net > I am trying to create clone of element then convert the element to > string. Do some string manipulation and then convert the string > back to > element. > > //***This will insert new elements inside the clone*** > Element newElement = (Element) currElement.clone(); > > //***We need to replace few values in the new element so convert to > string*** > String strElem = newElement.asXML(); > > // Do something with string (internal logic) > > How do I convert string to element and insert that in my xml > document????????????????????????? > > //this would put the element in the doc > this.insertElementAt(newElement, this.root.indexOf(currElement)+1); > > > > Thanks, > > Devang > > 972-550-2746 > > > > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ dom4j-user mailing list dom4j-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-user