Compartilhar via


Creating XML Trees

One of the most common XML tasks is constructing an XML tree. This section describes several ways to create them.

In This Section

Topic

Description

Functional Construction (LINQ to XML)

Provides an overview of functional construction in LINQ to XML. Functional construction enables you to create all or part of your XML tree in a single statement. This topic also shows how to embed queries when constructing an XML tree.

Creating XML Trees in C# (LINQ to XML)

Shows how to create trees in C#.

Introduction to XML Literals in Visual Basic

Provides a quick introduction to creating trees in Visual Basic by using XML literals. This topic includes links to the Visual Basic documentation of XML literals.

Cloning vs. Attaching

Demonstrates the difference between adding nodes from an existing XML tree (nodes are cloned and then added) and adding nodes with no parent (they are simply attached).

Parsing XML

Shows how to parse XML from a variety of sources. LINQ to XML is layered on top of XmlReader, which is used to parse the XML.

How to: Populate an XML Tree with an XmlWriter (LINQ to XML)

Shows how to populate an XML tree by using an XmlWriter.

How to: Validate Using XSD (LINQ to XML)

Shows how to validate an XML tree using XSD.

Valid Content of XElement and XDocument Objects

Describes the valid arguments that can be passed to the constructors and methods that are used to add content to elements and documents.

See Also

Concepts

Programming Guide (LINQ to XML)