using System;
using System.IO;
using System.Xml;
public class Sample
{
public static void Main()
{
using (XmlReader reader = XmlReader.Create("data.xml"))
{
reader.ReadToDescendant("item");
do
{
reader.MoveToAttribute("sale-item");
Boolean onSale = reader.ReadContentAsBoolean();
if (onSale)
{
Console.WriteLine(reader["productID"]);
}
} while (reader.ReadToNextSibling("item"));
}
}
}