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 7802023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:07:56+00:00 2026-06-02T01:07:56+00:00

using XDocument with xpath to parse XML which one is better in perfomance ?

  • 0

using XDocument with xpath to parse XML
which one is better in perfomance ?

e.g. To search for tag and get value in xml

tags = xmlDoc.Descendants(xmlTag);

or

xml.SelectSingleNode("//root/node")

So which one will be faster?

  • 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-06-02T01:07:59+00:00Added an answer on June 2, 2026 at 1:07 am

    XPath doesn’t parse XML… it’s a query language used on top of any other XML API which supports it. (For example, you can use XPath over XmlDocument or XDocument.)

    To find out which query would be faster usefully, you should try your actual XPath and LINQ to XML query on samples of your actual data. I would expect XPath to be faster in some situations, and LINQ to XML to be faster in others.

    However, I’d be surprised if the query execution speed was actually the bottleneck in your code – do you have evidence that it is? You should first be asking yourself which is most readable. Implement that code, then see whether it’s fast enough.

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

Sidebar

Related Questions

I am using the XPath in PHP 5 to parse a XML document. The
I'm using VBA to parse the soap xml with MSXML2 and XPath but while
I'm trying to parse an xml file using XPath DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); domFactory.setNamespaceAware(true);
I'm using XPath in .NET to parse an XML document, along the lines of:
I am using DOM parser and XPATH to parse a my XML file. I
I am using the following code to query some XML with XPath I get
I'm trying to filter an XML file using XPath. The XPath that I'm using
I've been trying to write a PHP script to parse an XML document using
I am trying to parse a bunch of XML files. I am using Nokogiri,
Lately I've been using XPathDocument and XNavigator to parse an XML file for a

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.