I have a class written in the following manner:
[XmlRoot]
public class MyXMLElement
{
[XmlAttribute]
public string AnAttribute { get; set; }
[XmlAttribute]
public string AnotherElementAttribute { get; set; }
}
When this is serialized, I want to set its Value, so I get something like the following:
<MyXMLElement AnAttribute="something" AnotherElementAttribute="something else">The inner value of the element</MyXMLElement>
Anyone have ideas?
If you want to set the value of the element, you can use the
[XmlText]attribute: