Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1035143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:30:05+00:00 2026-05-16T14:30:05+00:00

It’s been long time I manipulated raw XML. I have used XmlDocument and remember

  • 0

It’s been long time I manipulated raw XML. I have used XmlDocument and remember something called XDocument begining to evolve, but that was few years ago. What M$ recomends in these days?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:30:05+00:00Added an answer on May 16, 2026 at 2:30 pm

    XDocument is part of LINQ to XML – and it’s definitely what I’d use for 99% of XML work these days.

    LINQ to XML isn’t quite what it sounds like – it’s not really a LINQ provider in the way that LINQ to SQL is, for example… it’s an XML API which has been designed to play well with LINQ to Objects. It supports a declarative construction model and its querying fits in very well with LINQ to Objects, allowing you to find elements, attributes etc really easily.

    Oh, and its namespace support is awesomely simple:

    XNamespace ns = "http://some.url.here";
    XElement element = new XElement(ns + "elementName");
    

    Basically it’s lovely – it beats using XmlDocument and XmlReader into a cocked hat, for most situations. Occasionally XmlReader may be useful for streaming efficiency, but you can create an XElement from an XmlReader, which will just read the “current” element and leave the XmlReader positioned after it. This allows for sort of “structured streaming” with the benefits of LINQ to XML, so long as you only need one element (and any child elements, of course) at a time.

    With respect to eidylon’s answer: C# doesn’t support XML literals; it takes the view that a language shouldn’t get involved in a specific technology such as XML directly. How big a deal you believe that to be is a personal matter 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.