IElement element = document.CreateElement("div"); element.SetAttribute("class", "container");
IElement parent = document.GetElementById("parent"); IElement child = document.CreateElement("div"); parent.AppendChild(child);In this example, we get a reference to a parent element using the `GetElementById` method of the `document` object. We then create a new `div` element and append it as a child to the parent element using the `AppendChild` method of the `IElement` interface. Package/Library: This is from the `AngleSharp` package.