Courseiva

UiPath-ADPv1 Advanced Data Manipulation Practice Question

A developer is parsing a large XML string returned by a SOAP service. The document contains a default namespace declared as xmlns="http://tempuri.org/". The developer uses an XDocument variable and writes doc.Descendants("Customer") to retrieve all Customer elements, but the result is empty even though the XML clearly contains Customer elements. What is the correct fix?

⚠ Common exam trap

The trap here is assuming a string element name matches regardless of namespace, when LINQ to XML requires the namespace to be part of the name match.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Replace Descendants("Customer") with Descendants(XName.Get("Customer", "http://tempuri.org/")) so the query includes the namespace.

LINQ to XML compares element names including their namespace URI. A default xmlns puts every unprefixed element into that namespace, so an unqualified name string matches nothing. Supplying the namespace via XName.Get (or a namespace-aware query) makes the query resolve correctly without altering the source document.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Call doc.Descendants().Where(Function(e) e.Name.LocalName = "Customer") to match on the local name only.

    Why it's wrong here

    Filtering on LocalName does return the elements, but it is a looser match that also captures Customer elements from any other namespace, which can silently pull in unrelated data. It also forces a full descendant scan with a predicate rather than an indexed name lookup, which is slower on large documents.

  • ✗

    Remove the xmlns attribute from the XML string before parsing so the elements become unqualified.

    Why it's wrong here

    Stripping the namespace declaration mutates the payload and can break signature validation or downstream consumers that expect the namespace. It also treats a symptom rather than addressing how LINQ to XML resolves names, so any future namespaced element will fail again.

  • ✓

    Replace Descendants("Customer") with Descendants(XName.Get("Customer", "http://tempuri.org/")) so the query includes the namespace.

    Why this is correct

    In LINQ to XML, element names carry their namespace. A bare string 'Customer' is treated as an empty namespace, so it never matches namespaced elements. XName.Get combines the local name with the namespace URI, producing the correct qualified name that matches the document's default namespace.

  • ✗

    Convert the string to an XmlDocument and use GetElementsByTagName("Customer"), which ignores namespaces by default.

    Why it's wrong here

    GetElementsByTagName matches on the qualified tag name string, which for a default-namespaced element is still 'Customer', so it can work, but it abandons the LINQ-to-XML approach the developer already built and loses the strongly typed query model. It is a workaround, not the correct fix for the stated XDocument query.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

This UiPath-ADPv1 question is part of Courseiva's 276-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official UiPath exam blueprint

This UiPath-ADPv1 practice question is part of Courseiva's free UiPath certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the UiPath-ADPv1 exam.