I have a class called Profile that has some simple properties and then it can have a collection of ProfileItem that again has some simple properties and then it can have a collection of ProfileItem (RECURSION).
Now I am trying to generated a very simple save function using XML Literals that come with VB.NET (3.5).
The code I am using is the following:
Dim xdoc As XDocument = _
<?xml version="1.0" encoding="utf-8"?>
<profiles>
<%= _
From p In _Profiles _
Select <profile name=<%= p.Name %>>
<%= _
From i In p.GetProfileItems _
Select <item>
<name><%= i.Name %></name>
<action><%= i.Action.ToString %></action>
<type><%= i.Type.ToString %></type>
<arguments><%= i.Arguments %></arguments>
<dependencies>
<%= _
From d In i.GetDependencies _
Select <dependency>
<name><%= d.Name %></name>
</dependency> _
%>
</dependencies>
</item> _
%>
</profile> _
%>
</profiles>
The part related to tag should become recursive, but I don't know if it is in some way supported by this syntax.
Should I rewrite all avoiding usage of XML Literal to implement recursion?