//Reader is on the <Metadata> element
        public static MetadataSet ReadFrom(XmlReader reader)
        {
            if (reader == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");

            MetadataSetSerializer xs = new MetadataSetSerializer();
            return (MetadataSet)xs.Deserialize(reader);
        }
        public static MetadataSet ReadFrom(XmlReader reader)
        {
            if (reader == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");
            }
            MetadataSetSerializer serializer = new MetadataSetSerializer();

            return((MetadataSet)serializer.Deserialize(reader));
        }
        //Reader in on the <Metadata> element
        void IXmlSerializable.ReadXml(XmlReader reader)
        {
            if (reader == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");

            MetadataSetSerializer xs = new MetadataSetSerializer();
            xs.ProcessOuterElement = false;

            MetadataSet metadataSet = (MetadataSet)xs.Deserialize(reader);

            this.sections = metadataSet.MetadataSections;
            this.attributes = metadataSet.Attributes;
        }
 void IXmlSerializable.ReadXml(XmlReader reader)
 {
     if (reader == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");
     }
     MetadataSetSerializer serializer = new MetadataSetSerializer {
         ProcessOuterElement = false
     };
     MetadataSet set = (MetadataSet) serializer.Deserialize(reader);
     this.sections = set.MetadataSections;
     this.attributes = set.Attributes;
 }
        void IXmlSerializable.ReadXml(XmlReader reader)
        {
            if (reader == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("reader");
            }
            MetadataSetSerializer serializer = new MetadataSetSerializer {
                ProcessOuterElement = false
            };
            MetadataSet set = (MetadataSet)serializer.Deserialize(reader);

            this.sections   = set.MetadataSections;
            this.attributes = set.Attributes;
        }