I have a .xsd file which I use to generate code with the xsd.exe tool from Visual Studio. Some class members are Guids and the xsd.exe tool gives 2 warnings:
Namespa
Citation from here:
XmlSchema guidSchema = new XmlSchema();
guidSchema.TargetNamespace = "http://microsoft.com/wsdl/types/";
XmlSchemaSimpleTypeRestriction guidRestriction = new XmlSchemaSimpleTypeRestriction();
guidRestriction.BaseTypeName = new XmlQualifiedName("string", XmlSchema.Namespace);
XmlSchemaPatternFacet guidPattern = new XmlSchemaPatternFacet();
guidPattern.Value = @"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
guidRestriction.Facets.Add(guidPattern);
XmlSchemaSimpleType guidType = new XmlSchemaSimpleType();
guidType.Name = "guid";
guidType.Content = guidRestriction;
guidSchema.Items.Add(guidType);
schemaSet.Add(guidSchema);
XmlSchema speakerSchema = new XmlSchema();
speakerSchema.TargetNamespace = "http://www.microsoft.com/events/teched2005/";
// ...
XmlSchemaElement idElement = new XmlSchemaElement();
idElement.Name = "ID";
// Here's where the magic happens...
idElement.SchemaTypeName = new XmlQualifiedName("guid", "http://microsoft.com/wsdl/types/");