Have a WCF service, which has a DataMember with custom nodes (names and numbers of items may be different)
Example:
<AppData>
<sometag>something</sometag>
<othertag>something else</othertag>
</AppData>
Member definition as:
<DataMember(IsRequired:=False)>
Public AppData As XmlElement
it’s working only for one item.
Definition like:
<DataMember(IsRequired:=False)>
Public AppData As List(Of XmlElement)
wrapped inner tags in class name tag:
<AppData>
<XmlElement><sometag>something</sometag></XmlElement>
<XmlElement><othertag>something else</othertag></XmlElement>
</AppData>
Keep
AppDataas anXElement– then when you are ready to send the data just create a newXElementpassing the list to it – it will create a parent with many child elements one for eachXElement in the list. The constructor forXElement isIEnumerable<XElement>aware