Listing 1: Convert XPath into LINQ to XML: XML: Build a Basic Structure

XML structures vary widely in arrangement, complexity, and whether the data is held in content or attributes. A variation of this sample XML is used throughout this article.

 <?xml version="1.0" encoding="utf-8"?>
<!-- From Microsoft Sample Files with a namespace 
   added -->
<Root xmlns="http:CustomersAndOrder">
   <Customers>
      <Customer CustomerID="GREAL">
      <!-- Etc. -->
      <FullAddress>
         <Address>2732 Baker Blvd.</Address>
         <City>Eugene</City>
         <!-- Etc. -->
      </FullAddress>
      </Customer>
         <!-- Etc. -->
   </Customers>
   <Orders>
      <Order>
         <!-- Etc. -->
         <ShipInfo ShippedDate=
            "1997-05-09T00:00:00">
         <!-- Etc. -->
         <ShipRegion>OR</ShipRegion>
         </ShipInfo>
      </Order>
      <!-- Etc. -->
   </Orders>
</Root>
comments powered by Disqus

Featured

  • .NET 11 Preview 6 Roundup: ASP.NET Core, MAUI, C#, EF Core and SDK Updates

    Microsoft's sixth .NET 11 preview advances async validation, C# unions, cross-platform UI controls, database queries, testing tools, Native AOT and container images.

  • Low-Coding in the Age of AI: Dataverse Embraces Copilot, Claude and Cursor

    Microsoft is extending Dataverse into coding-agent marketplaces while expanding its MCP tools, certification program and governance controls.

  • Visual Studio Takes Aim at Copilot Billing Shock

    Beyond Copilot usage visibility, the June update delivers several other enhancements centered on AI-assisted development, security and quality-of-life improvements. Here's a quick rundown of the remaining additions announced by Microsoft.

  • Claude AI Gets Yet Another Boost in VS Code 1.128

    The July 8, 2026, Visual Studio Code update expands agent workflows, chat attachments, browser-tab controls, OS-level shortcuts and enterprise telemetry management.

Subscribe on YouTube