<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <GetReviewsFromManufacturerCategoryAndTypeResponse xmlns="http://www.caranddriving.com/ws"> <GetReviewsFromManufacturerCategoryAndTypeResult> <code>0</code> <message /> <count>8</count> <reviewlist> <review> <reviewid>309171</reviewid> <manufacturer>Audi</manufacturer> <nameofcar>Audi A1</nameofcar> <paragraphlist> <paragraph> <type>By Line</type> <headline /> <text>Audi's A1 might well be at its best when fitted with a particularly clever 1.4-litre petrol engine. Andy Enright reports.</text> </paragraph> <paragraph> <type>Ten Second Review</type> <headline>Ten Second Review</headline> <text>The A1 1.4 TFSI CoD features a modern turbocharged petrol engine that features a cylinder cut-off system which means that when cruising, it'll run on two rather than four cylinders. The result? Economy of 60.1mpg, yet it has the ability to nip to 60mph in less than 8 seconds.</text> </paragraph> </paragraphlist> <photolist> <photo> <mini>http://f2.caranddriving.com/images/new/mini/AudiA114TFSICoD0313(2).jpg</mini> <std>http://f2.caranddriving.com/images/new/std/AudiA114TFSICoD0313(2).jpg</std> <big>http://f2.caranddriving.com/images/new/big/audia114tfsicod0313(2).jpg</big> <large>http://f2.caranddriving.com/images/new/large/AudiA114TFSICoD0313(2).jpg</large> <isdefault>false</isdefault> </photo> <photo> <mini>http://f2.caranddriving.com/images/new/mini/AudiA114TFSICoD0313.jpg</mini> <std>http://f2.caranddriving.com/images/new/std/AudiA114TFSICoD0313.jpg</std> <big>http://f2.caranddriving.com/images/new/big/audia114tfsicod0313.jpg</big> <large>http://f2.caranddriving.com/images/new/large/AudiA114TFSICoD0313.jpg</large> <isdefault>true</isdefault> </photo> </photolist> </review> <review> <reviewid>8985</reviewid> <manufacturer>Audi</manufacturer> <nameofcar>Audi A1 1.6 TDI SE</nameofcar> <paragraphlist> <paragraph> <type>By Line</type> <headline /> <text>Audi's A1 might well be at its best when fitted with a particularly clever 1.4-litre petrol engine. Andy Enright reports.</text> </paragraph> <paragraph> <type>Ten Second Review</type> <headline>Ten Second Review</headline> <text>The A1 1.4 TFSI CoD features a modern turbocharged petrol engine that features a cylinder cut-off system which means that when cruising, it'll run on two rather than four cylinders. The result? Economy of 60.1mpg, yet it has the ability to nip to 60mph in less than 8 seconds.</text> </paragraph> </paragraphlist> <photolist> <photo> <mini>http://f2.caranddriving.com/images/new/mini/AudiA114TFSICoD0313(2).jpg</mini> <std>http://f2.caranddriving.com/images/new/std/AudiA114TFSICoD0313(2).jpg</std> <big>http://f2.caranddriving.com/images/new/big/audia114tfsicod0313(2).jpg</big> <large>http://f2.caranddriving.com/images/new/large/AudiA114TFSICoD0313(2).jpg</large> <isdefault>false</isdefault> </photo> <photo> <mini>http://f2.caranddriving.com/images/new/mini/AudiA114TFSICoD0313.jpg</mini> <std>http://f2.caranddriving.com/images/new/std/AudiA114TFSICoD0313.jpg</std> <big>http://f2.caranddriving.com/images/new/big/audia114tfsicod0313.jpg</big> <large>http://f2.caranddriving.com/images/new/large/AudiA114TFSICoD0313.jpg</large> <isdefault>true</isdefault> </photo> </photolist> </review> </GetReviewsFromManufacturerCategoryAndTypeResult> </GetReviewsFromManufacturerCategoryAndTypeResponse> </soap:Body> </soap:Envelope>
XDocument xDocument = XDocument.Parse(xml); string manufacturer = string.Empty; var aa = xDocument.Descendants("review").Where(x => x.Element("nameofcar").Value.Equals("Audi A1")); foreach (var a in aa) { manufacturer = a.Element("manufacturer").Value; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)