You can use XmlDocument
to load and query nodes. This works great if you know the exact nodes and the types.
There are lots of great articles about XML parsing in C# (https://learn.microsoft.com/en-us/dotnet/standard/data/xml/), and some good answers here: C# Parsing XML File
For your case, the parsing could be simplified like this:
void Run()
{
string xml = @"<?xml version=""1.0"" encoding=""utf-8""?>
<root>
<Classic>
<value1>6</value1>
<value2>18.7</value2>
<value3>1</value3>
</Classic>
</root>";
var doc = new XmlDocument();
doc.LoadXml(xml);
var classicNode = doc.SelectSingleNode("/root/Classic");
int x = int.Parse(classicNode.SelectSingleNode("value1").InnerText);
double y = double.Parse(classicNode.SelectSingleNode("value2").InnerText);
int z = int.Parse(classicNode.SelectSingleNode("value3").InnerText);
Console.WriteLine($"{x}, {y}, {z}");
}
Another approach is to use XDocument with XPathSelectElement
extension
void Run2()
{
string xml = @"<?xml version=""1.0"" encoding=""utf-8""?>
<root>
<Classic>
<value1>6</value1>
<value2>18.7</value2>
<value3>1</value3>
</Classic>
</root>";
var doc = XDocument.Parse(xml);
int x = int.Parse(doc.XPathSelectElement("root/Classic/value1").Value);
double y = double.Parse(doc.XPathSelectElement("root/Classic/value2").Value);
int z = int.Parse(doc.XPathSelectElement("root/Classic/value3").Value);
}