public static void Main()
<name> The cat in the hat </name>
<name> another book </name>
<name> a new book </name>
<content> story </content>
<content> fiction </content>
var fileone = XDocument.Parse(xml1);
var filetwo = XDocument.Parse(xml2);
from a in fileone.Descendants("book")
join b in filetwo.Descendants("book")
on (string)a.Element("bookID") equals (string)b.Element("bookID")
select new XElement("bookInfo", a.Element("bookID"), a.Element("name"), b.Element("content"));
var result = new XElement("result", bookInfos);
Console.WriteLine(result.ToString());