Here you can find the source of copy(Element e)
public static Element copy(Element e)
//package com.java2s; //License from project: Open Source License import org.jsoup.nodes.Attribute; import org.jsoup.nodes.Element; import org.jsoup.parser.Tag; public class Main { public static Element copy(Element e) { Element res = new Element(Tag.valueOf(e.tagName()), e.baseUri()); for (Attribute a : e.attributes()) { res.attr(a.getKey(), a.getValue()); }//w ww.ja v a2s .com res.html(e.html()); return res; } }