public static XmlSchema ReadSchemaFromText(String text) { StringReader reader = new StringReader( text ); XmlSchema myschema = null; try { myschema = XmlSchema.Read(reader, ValidationCallBack); } finally { reader.Close(); } return myschema; }