The easiest way is to use [XmlEnum] attribute like so:
[Serializable]
public enum EnumToSerialize
{
[XmlEnum("1")]
One = 1,
[XmlEnum("2")]
Two = 2
}
This will serialize into XML (say that the parent class is CustomClass) like so:
<CustomClass>
<EnumValue>2</EnumValue>
</CustomClass>