There seems to be a lot of questions here so I don't know exactly what you're looking for.
Is there a procedure? 1:n relationships
I don't understand this question.
From the data model to an XML file and generate queries from it?
Yes, it is called LINQ to XML. It is really just using LINQ against the underlying XML model that is created. Refer to the link for how to use it. However XML is a serialization format so ideally you shouldn't be working with it directly. If you already have the data in your database then just use LINQ against your database like normal. The only time you should really worry about the XML is if you get XML from someone and have to process it from there. If you are sending XML to someone then you shouldn't really need to write queries against it.
Is there perhaps a wizard where I can create the data model visually and an XML structure is generated?
There are third party tools that can do it but unless your data structure is really large and complex then it is probably just easier, cleaner and more efficient to write them yourself. It is trivial to create a C# model that is attributed for XML serialization.
What is better. This.
The first one is probably cleaner to read. Ultimately it is converted to the extension method equivalent. Use whichever one reads better to you. But we're making an assumption about how your objects were populated. If you are using Entity Framework or another ORM library then the first code will join the tables at the database and return the data to you. If that data is not yet loaded then it'll get loaded at that point. In the second block it is using the Orders
on the customers that has already been loaded (ignoring lazy loading). If you haven't loaded the orders (using your ORM) then it won't load the data unless you're using lazy loading (which is bad). So from a purely "safe" point of view I'd lean toward the first code.