Xml parse object inside of list of objects inside object using LINQ

Xml parse object inside of list of objects inside object using LINQ

<strong>XML FILE</strong>

XML FILE

<Lines>
    <LineEntity>
      <Id>33947</Id>
      <Name>SEC_137438957044</Name>
      <IsUnderground>true</IsUnderground>
      <R>0.209</R>
      <ConductorMaterial>Steel</ConductorMaterial>
      <LineType>Cable</LineType>
      <ThermalConstantHeat>2400</ThermalConstantHeat>
      <FirstEnd>41990</FirstEnd>
      <SecondEnd>41992</SecondEnd>
      <Vertices>
        <Point>
          <X>407566.68007470988</X>
          <Y>5013899.3558040857</Y>
        </Point>
        <Point>
          <X>407625.00589398207</X>
          <Y>5013876.8697334668</Y>
        </Point>
        <Point>
          <X>407717.51971015992</X>
          <Y>5014160.9525629422</Y>
        </Point>
        <Point>
          <X>407559.40091708023</X>
          <Y>5014220.4665799234</Y>
        </Point>
      </Vertices>
    </LineEntity>
</Lines>

I want to get this Vertices object with Points, but I don't know how to get to it. What I tried so far:

var lines = xdoc.Descendants("LineEntity")
                 .Select(line => new Line
    {
        Id = (double)line.Element("Id"),
        Name = (string)line.Element("Name"),
        ConductorMaterial = (string)line.Element("ConductorMaterial"),
        IsUnderground = (bool)line.Element("IsUnderground"),
        R = (decimal)line.Element("R"),
        FirstEnd = (int)line.Element("FirstEnd"),
        SecondEnd = (int)line.Element("SecondEnd"),
        LineType = (string)line.Element("LineType"),
        ThermalConstantHeat = (int)line.Element("ThermalConstantHeat"),
        Vertices = line.Descendants("Vertices").Select(p => new Point {
        X = (decimal)p. //can't access Element
    })
}).ToList();


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

C/C++ vs. Rust: A developer’s perspective

In this post, you'll see the difference between Rust and C/C++ in a developer’s perspective

Compiled C# Linq expression and querying Mongo

I've inherited some code from a former employee that queries a mongo DB using compiled Linq expressions and the&nbsp;<a href="https://github.com/RobThree/MongoRepository" target="_blank">MongoRepository library</a>&nbsp;(which sits on top of the MongoDB C# driver).