public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn) { var typeNamespace = UriUtility.RemoveExtension(absoluteUri); var typeName = Path.GetFileNameWithoutExtension(typeNamespace); var categoryPath = this.dataSet.GetTypeCategoryPath(typeNamespace); var type = this.dataSet.Types[typeName, categoryPath]; if (type == null) { return(null); } var bytes = Encoding.ASCII.GetBytes(type.GetXmlSchema()); return(new MemoryStream(bytes)); }