public void InsertElementTest() { var doc = new XmlDoc("<root/>"); var node = doc.InsertBefore(doc.CreateXmlDeclaration("1.0", "utf-8", ""), doc.DocumentElement); Assert.IsNotNull(node); var firstElement = doc.AddElementText(doc.DocumentElement, "first", ""); Assert.IsNotNull(firstElement); var second = doc.InsertElementBefore(firstElement, "second", ""); Assert.IsNotNull(second); }