concept xml transformation in category .net

appears as: XML trsformations, XML trsformation
LINQ in Action

This is an excerpt from Manning's book LINQ in Action.

With this query, we’ve selected the title, publisher, and authors out of the XML file. We’ve done extra work to format the list of author names as a comma-separated list to match our desired output format. Now that we have our functional construction statements and our query, it’s time to combine the two into a single LINQ to XML transformation. See listing 10.25.

Listing 10.25. Transform XML into XHTML with LINQ to XML transformations
XElement html = new XElement("html", new XElement("body", new XElement("h1", "LINQ Books Library"), from book in booksXml.Descendants("book") select new XElement("div", new XElement("b", (string)book.Element("title")), "By: " + String.Join(", ", book.Descendants("author") .Select(b => (string)b).ToArray()) + "Published By: " + (string)book.Element("publisher") ) ) );