XDocument xdoc = XDocument.Load(@"XMLFile1.xml");
var product = from u in xdoc.Descendants("product")
where u.Parent.Attribute("urlKeyWords").Value.IndexOf("postpar") >= 0
select u;
foreach (var u in product)
{
string name = u.Attribute("text").Value;
Console.WriteLine(name);
}
Console.Read();
<?xml version="1.0" encoding="utf-8" ?>
<Products>
<WebSite urlKeyWords="postpartum">
<product text="dd" value="dd" amount ="1000"></product>
<product text="dd1" value="dd1" amount ="2000"></product>
<product text="dd2" value="dd2" amount ="3000"></product>
<product text="dd3" value="dd3" amount ="4000"></product>
</WebSite>
<WebSite urlKeyWords="aaaaaa">
<product text="aa" value="aa" amount ="11"></product>
<product text="aa2" value="aa2" amount ="112"></product>
<product text="aa3" value="aa3" amount ="113"></product>
</WebSite>
<WebSite urlKeyWords="bbbbbb">
<product text="bbbb" value="bbbb" amount ="22"></product>
<product text="bbbb22" value="bbbb22" amount ="2222"></product>
</WebSite>
</Products>