using System.Collections;
using System.Collections.Generic;
using System.Globalization;
public static void Main()
string input = @"<tv info=""blahblah"">
<channel id=""Channelname1"">
<display-name lang=""en"">Channelname1</display-name>
<icon src=""somelogo.png"" />
<url>http://somelink.com</url>
<channel-category>SomeValue</channel-category>
<channel id=""Channelname2"">
<display-name lang=""en"">Channelname2</display-name>
<icon src=""somelogo.png"" />
<url>http://somelink.com</url>
XDocument doc = XDocument.Parse(input);
if(doc.Descendants("channel").Any(x=>(string)x.Attribute("id") == "Channelname1" && x.Element("channel-category") != null))
Console.WriteLine("Element exist");
else Console.WriteLine("Element not exist");