public static void Main(string[] args)
@"<xs:schema attributeFormDefault='unqualified' elementFormDefault='qualified' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name='Questions'>
<xs:element name='Question' maxOccurs='unbounded' minOccurs='1'>
<xs:element type='xs:string' name='Content'/>
<xs:element type='xs:string' name='Answer' maxOccurs='unbounded' minOccurs='2'/>
<xs:element type='xs:int' name='CorrectIndex'/>
<xs:element type='xs:int' name='Difficulty'/>
const string xml = @"<Questions>
<Content>This is a question?</Content>
<CorrectIndex>1</CorrectIndex>
<Difficulty>2</Difficulty>
var schemas = new XmlSchemaSet();
schemas.Add("", XmlReader.Create(new StringReader(schema)));
var doc = XDocument.Parse(xml);
doc.Validate(schemas, (o, e) =>
Console.WriteLine("{0}", e.Message);
Console.WriteLine("Document has {0} errors", errors);