you can produce a log output to show the SQL commands that LINQ to SQL generates. This logging feature (which uses Log) is helpful in debugging, and in determining that the commands being sent to the database accurately represent your query.
try something like this
var a = from record in table.Elements("Record")
select new
{
one = (string)record.Elements().ElementAt(0),
two = (string)record.Elements().ElementAt(1)
};
//or
// Attach the log to show generated SQL.
db.Log = Console.Out;
// Query for id.
IQueryable<student> custQuery =
from stud in students
select stud;
foreach (Customer cust in custQuery)
{
Console.WriteLine("ID={0}", stud.ID,);
}
// Prevent console window from closing.
Console.ReadLine();