views:

431

answers:

1

Hi,

I have an xml that looks like this:

<Config>
<A></A>
<Template><B/><C/></Template>
</Config>

and I would like to deserialize it in to get the <Template><B/><C/></Template> bit as a XmlElement or XmlNode. But when I try like this:

public class Config
{
     public string A;
     public XmlElement Template;
}

the Template is set to <B/> only. Any ideas?

+5  A: 

Decorate your Template member with an XmlAnyElement attribute. That should do the trick.

Filip
Cheers, works like a dream!
Grzenio