public virtual void ChildNodesCopy() { Document doc = iText.StyledXmlParser.Jsoup.Jsoup.Parse("<div id=1>Text 1 <p>One</p> Text 2 <p>Two<p>Three</div><div id=2>" ); iText.StyledXmlParser.Jsoup.Nodes.Element div1 = doc.Select("#1").First(); iText.StyledXmlParser.Jsoup.Nodes.Element div2 = doc.Select("#2").First(); IList <iText.StyledXmlParser.Jsoup.Nodes.Node> divChildren = div1.ChildNodesCopy(); NUnit.Framework.Assert.AreEqual(5, divChildren.Count); TextNode tn1 = (TextNode)div1.ChildNode(0); TextNode tn2 = (TextNode)divChildren[0]; tn2.Text("Text 1 updated"); NUnit.Framework.Assert.AreEqual("Text 1 ", tn1.Text()); div2.InsertChildren(-1, divChildren); NUnit.Framework.Assert.AreEqual("<div id=\"1\">Text 1 <p>One</p> Text 2 <p>Two</p><p>Three</p></div><div id=\"2\">Text 1 updated" + "<p>One</p> Text 2 <p>Two</p><p>Three</p></div>", TextUtil.StripNewlines(doc.Body().Html())); }