using System; using System.Xml; using System.Xml.Linq; using Umbraco.Core.Configuration; using Umbraco.Core.PropertyEditors; using Umbraco.Core.Services; using umbraco.interfaces; namespace Umbraco.Core.Models { public static class PropertyExtensions { /// /// Creates the xml representation for the object /// /// to generate xml for /// Xml of the property and its value public static XElement ToXml(this Property property) { var xmlSerializer = new EntityXmlSerializer(); return xmlSerializer.Serialize(ApplicationContext.Current.Services.DataTypeService, property); } } }