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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:43:03+00:00 2026-06-11T23:43:03+00:00

In the below xml file: <SVCs> <SVC> <id>001</id> <request>Send SMS SVC 001 Request</request> <reposne>Send

  • 0

In the below xml file:

    <SVCs>
         <SVC>
              <id>001</id>
              <request>Send SMS SVC 001 Request</request>
              <reposne>Send SMS SVC 001 Response</reposne>
         </SVC>
         <SVC>
               <id>002</id>
               <request>Send SMS SVC 002 Request</request>
               <reposne>Send SMS SVC 002 Response</reposne>
        </SVC>
    </SVCs>

I need to search for id say 002, and get the request and response for the same in form of plain text. i am working in winforms C# .net 4.0. How do i achieve this?
I am using XMLDocument namespace to parse through the document.

I am really new to XML library and i think this is one of the basic questions. I really googled a lot but couldn’t find how to get the inner text by searching for a tag.

  • 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-11T23:43:04+00:00Added an answer on June 11, 2026 at 11:43 pm

    I would use linq2xml

    XDocument xDoc = XDocument.Parse(xml);
    var svc = xDoc.XPathSelectElement("//SVC[id='002']");
    
    var req = svc.Element("request").Value;
    var resp = svc.Element("reposne").Value;
    

    or

    var svc = xDoc.Descendants("SVC")
                  .First(s => s.Element("id").Value == "002");
    

    PS: I keep the same typo reposne

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

Sidebar

Related Questions

I need to get the value 3 from the below xml file using groovy
I have the below xml file and I need to use an xpath to
How to read the below xml file and write its content into a plain
How do I change my XML file below to have CAS return to the
I already implemented to create the XML file below with XmlTextWriter when application initialization.
I have an xml file likes below. <?xml version=1.0 encoding=utf-8 ?> <Book> <Title>Title</Title> <Content>Content</Content>
I'm traversing an xml file as below: <?xml version=1.0 encoding=ISO-8859-1?> <wrapper> <site base=http://www.example1.co.uk/ name=example
I have a xml file as below: <?xml version=1.0 encoding=UTF-8 standalone=no?> <RULES> <RULE DESCRIPTION=
I setup a logging.xml file as shown below. This file includes output to the
I have a flat structured XML file as below: <rs> <r id=r1 lev=0/> <r

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.