using System;
using System.Linq;
using System.Xml.Linq;
public class MainClass {
public static void Main() {
XElement books = XElement.Parse(
@"
P
J
W
B
C
A
");
var titles =
from book in books.Elements("book")
where (string)book.Element("author") == "J"
select book.Element("title");
foreach (var title in titles)
Console.WriteLine(title.Value);
}
}