Highly Recommended I have published a free book on XML programming using C#. Free e-book: Programming XML with C# Learn more XML Programming Still hungry for more XML programming with C# and . Here is a dedicated section with hundreds of articles and code samples on XML programming using C# and . XML Programming in C# About Sample Example 2 In this sample example, I read an XML file using Xml Text Reader and call Read method to read its node one by one until end of the file.

xmlvalidatingreader set schema-4

The Load and Load Xml methods can be used to load XML documents and Save method to save a document respectively. Few of them are Xml Convert, Xml Linked Node, and Xml Node List. Besides Xml Reader methods and properties, these classes also contain members to read text, node, and schemas respectively.

Xml Document Fragment class represents a document fragment, which can be used to add to a document. I am using Xml Text Reader class to read an XML file.

It contains methods and properties to write to XML documents.

This class has several Writexxx method to write every type of item of an XML document.

Then, you will see how to read and write XML documents. It also contains properties to get a parent or child, name, last child, node type and more. XPath Namespce contains XPath related classes to use XPath specifications.

This class is an abstract base class for many useful classes for inserting, removing, and replacing nodes, navigating through the document.

Some of these methods are Move To Attribute, Move To First Attribute, Move To Content, Move To First Content, Move To Element and Move To Next Attribute.

The Xml Reader class is an abstract bases classes and contains methods and properties to read a document. Besides reading functionality, this class also contains methods to navigate through a document nodes.

This namespace contains many classes to read and write XML documents.

It also provides functionality to add XML items such as attributes, comments, spaces, elements, and new nodes. This class contains many Move methods to move through a document. Reading XML Documents In my sample application, I'm using to read and display its data through Xml Text Reader. The Xml Text Reader, Xml Node Reader and Xml Validating Reader classes are derived from Xml Reader class.

List 1 reads a document and displays a node information using these properties.