Inside your foreach
, you can use
if (xnn.Attributes["Host"].Value == host)
{
foreach (XmlNode i in xnn.ChildNodes) // i is the child node inside <Brand Host="localhost:64995"></Brand>
{
if (i.Attributes["Name"].Value == "aaa") // or even i.Attributes["BrandId"].Value == "1"
{
// Do your stuff
}
}
}
Hope it helps!