Click here to Skip to main content
Rate this: bad
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 6:28am
Wes Aday at 12-Sep-12 11:31am
Reading the documentation,, is a good place to start.
Sergey Alexandrovich Kryukov at 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
0 Maciej Los 495
1 Sergey Alexandrovich Kryukov 429
2 OriginalGriff 360
3 CHill60 280
4 Sascha Lefévre 269
0 Sergey Alexandrovich Kryukov 10,017
1 OriginalGriff 9,495
2 Peter Leow 5,241
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 3,076

Advertise | Privacy | Mobile
Web03 | 2.8.150327.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2015
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