internal XmlDocument ToXml(string group, ITestResultSerializerFactory serializerFactory)
        {
            XmlDocument doc = new XmlDocument();
            //Check Metadata for xml serializer type, TDS is default value
            MetaDataEntry entry = ServiceLocator.Resolve <ConfigurationHolder>().GetFromMetaData(this.ProjectID, group, "XMLVersion");

            XMLAdapter.AdapterType xmlType = XMLAdapter.AdapterType.TDS;
            if (entry != null)
            {
                xmlType = Utilities.Utility.Value(entry.TextVal, XMLAdapter.AdapterType.TDS);
            }

            // if set to 1/true, any demographics in the file will be preserved
            //  Used only in the OSS environment to minimize configuration
            entry = ServiceLocator.Resolve <ConfigurationHolder>().GetFromMetaData(this.ProjectID, group, "IncludeAllDemographics");

            SerializationConfig config = null;

            if (entry != null && Convert.ToBoolean(entry.IntVal))
            {
                config = new SerializationConfigIncludeAllDemographics();
            }
            else
            {
                //get the serialization config from the project metadata
                config = new SerializationConfig(/*ConfigurationHolder.IncludeAccommodations(ProjectID, group),*/
                    ServiceLocator.Resolve <ConfigurationHolder>().GetRTSAttributes(this.projectID, group));
            }

            doc.LoadXml(serializerFactory.CreateSerializer(xmlType.ToString(), this).Serialize(config));
            return(doc);
        }