O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating XmlElements

To create an XmlElement, the XmlDocument provides the CreateElement methods. The methods create an XmlElement node with the specified name and an optional namespace. This code illustrates how to create an element:

C#
XmlElement newElement = xmlDoc.CreateElement("Book");

VB
Dim newElement As xmlDoc.CreateElement("Book")

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required