いくつかの単純なプロパティを持つProfileというクラスがあり、次にいくつかの単純なプロパティを持つProfileItemのコレクションを持つことができ、次にProfileItem (RECURSION)のコレクションを持つことができます。
現在、VB.NET (3.5) に付属の XML リテラルを使用して、非常に単純な保存関数を生成しようとしています。
私が使用しているコードは次のとおりです。
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>
タグに関する部分は再帰的になるはずですが、この構文で何らかの形でサポートされているかどうかはわかりません。
再帰を実装するために XML リテラルの使用を避けてすべて書き直す必要がありますか?