Here you can find the source of appendFragment(Element e, String fragment)
public static void appendFragment(Element e, String fragment)
//package com.java2s; // it under the terms of the GNU Lesser General Public License as published by import java.util.ArrayList; import java.util.List; import org.jsoup.Jsoup; import org.jsoup.nodes.Element; import org.jsoup.nodes.Node; public class Main { public static void appendFragment(Element e, String fragment) { Element doc = Jsoup.parse(fragment); appendFragment(e, doc);/*from www . j av a 2 s . c om*/ } public static void appendFragment(Element e, Element fragment) { List<Node> nodes = new ArrayList<>(); nodes.addAll(fragment.childNodes()); for (Node child : nodes) { e.appendChild(child); } } }