void Write32_XmlSchemaAttributeGroupRef(XmlSchemaAttributeGroupRef o) {
if ((object)o == null) return;
WriteStartElement("attributeGroup");
WriteAttribute(@"id", @"", ((System.String)o.@Id));
if (!o.RefName.IsEmpty) {
WriteAttribute("ref", "", o.RefName);
}
WriteAttributes((XmlAttribute[])o.@UnhandledAttributes, o);
Write5_XmlSchemaAnnotation((XmlSchemaAnnotation)o.@Annotation);
WriteEndElement();
}