So... There is a solution !
What we have to do is rather simple..
If our class Attribute looks like the following one :
{
public class Attribute
{
public Attribute(string name, int value)
{
this.Name = name;
this.Value = value;
}
public string Name;
public int Value;
}
}
The solution could be :
public class element : IXmlSerializable
{
List<Attribute> AttributeList;
public void WriteXml(XmlWriter writer)
{
foreach(var attribute in AttributeList)
{
writer.WriteAttributeString(attribute.Name,attribute.Value.ToString());
}
}
}
And the result is what i was looking for.