Â//if this is a serialized property
         Âif (Attribute.IsDefined(property, typeof(XmlSerializedAttribute)))
         Â{
           Â//obtain it's value
           ÂXmlSerializedAttribute attribute = (XmlSerializedAttribute)Attribute.GetCustomAttribute(property, typeof(XmlSerializedAttribute), false);
           Âobject value = property.GetValue(this, null);
           Âif (typeof(IXmlSerializable).IsAssignableFrom(property.PropertyType))
           Â{
             Â//if there is actually a value
             Âif (value != null)
             Â{
               Â// this child implements ToXml(), so cascade the call
               ÂrootElem.InnerXml += ((IXmlSerializable)value).ToXml(attribute.ElementName);
             Â}
           Â}
           Âelse
           Â{
             ÂXmlElement childElem = doc.CreateElement(attribute.ElementName);
             ÂchildElem.InnerText = value.ToString();
             ÂrootElem.AppendChild(childElem);
           Â}
         Â}