Click here to Skip to main content
12,882,506 members (27,701 online)
Rate this:
Please Sign up or sign in to vote.
See more: XML Beginner
What is the best way to create an XML document using C#? I'm a newbie with regards to XML and was wanting some guidelines/pointers to get started. Any help would be greatly appreciated.
Posted 12-Sep-12 5:28am
Wes Aday 12-Sep-12 11:31am
Reading the documentation,, is a good place to start.
Sergey Alexandrovich Kryukov 12-Sep-12 18:36pm
"Best" may means "fastest", "easiest", "most robust", you name it. So, it depends on what you want.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Based on different Scenarios you could use the following:

1. XMLSerializer : Assuming you have an object(class) and you need XML respresentation for this.[^]

2. XML Writer: If You are going to create each and every item.[^]

3. Through DataSet's WriteXml method : Assuming you have a dataset already[^]

4. XMLDocument.Load
If you already have a string/stream/TextReader/XmlReader respresentation of xml.[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I would suggest you to go through this: MSDN: Improving XML Performance[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170422.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100