C# XmlSerialization: Serialize string with attribute

Advertisements I want to serialize the following from C# classes/structures into xml: XML sample: <xml> <somename id="bla">content</somename> </xml> How can I achieve, that a string has an additional attribute called id? >Solution : I would use something like this: /* Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 */ using System; using System.Xml.Serialization; using System.Collections.Generic;… Read More C# XmlSerialization: Serialize string with attribute