@Yusuf , Welcome to Microsoft Q&A, you could try to use XmlDocument.SelectNodes to get your wanted data by looping through the xml file.
Here is a code example you could refer to.
static void Main(string[] args)
{
XmlDocument doc = new XmlDocument();
doc.Load(@"test.xml");
foreach (XmlNode item in doc.SelectNodes("descendant::Automobile"))
{
foreach (XmlNode node in item.ChildNodes)
{
if(node!=null)
{
Console.WriteLine(node.InnerText);
}
}
Console.WriteLine(" ");
}
}
Tested result:
Best Regards,
Jack
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.