public WolframAlphaValidationResult ValidateQuery(string Response)
    {
        XmlDocument Document = new XmlDocument();
        WolframAlphaValidationResult Result = null;

        try {
            Document.LoadXml(Response);
            Result = ValidateQuery(Document);
        } catch {
        }
        Document = null;

        return(Result);
    }
    public WolframAlphaValidationResult ValidateQuery(XmlDocument Response)
    {
        System.Threading.Thread.Sleep(1);

        XmlNode MainNode = Response.SelectNodes("/validatequeryresult")[0];

        WA_ValidationResult              = new WolframAlphaValidationResult();
        WA_ValidationResult.Success      = MainNode.Attributes["success"].Value.toBool();
        WA_ValidationResult.ErrorOccured = MainNode.Attributes["error"].Value.toBool();
        WA_ValidationResult.Timing       = MainNode.Attributes["timing"].Value.toDouble();
        WA_ValidationResult.ParseData    = MainNode.SelectNodes("parsedata")[0].InnerText;
        WA_ValidationResult.Assumptions  = new List <WolframAlphaAssumption>();


        foreach (XmlNode Node in MainNode.SelectNodes("assumptions"))
        {
            System.Threading.Thread.Sleep(1);

            WolframAlphaAssumption Assumption = new WolframAlphaAssumption();

            Assumption.Word = Node.SelectNodes("word")[0].InnerText;

            XmlNode SubNode = Node.SelectNodes("categories")[0];


            foreach (XmlNode ContentNode in SubNode.SelectNodes("category"))
            {
                System.Threading.Thread.Sleep(1);

                Assumption.Categories.Add(ContentNode.InnerText);
            }

            WA_ValidationResult.Assumptions.Add(Assumption);
        }

        return(WA_ValidationResult);
    }
	public WolframAlphaValidationResult ValidateQuery(XmlDocument Response)
	{
		System.Threading.Thread.Sleep(1);

		XmlNode MainNode = Response.SelectNodes("/validatequeryresult")[0];

		WA_ValidationResult = new WolframAlphaValidationResult();		
		WA_ValidationResult.Success = MainNode.Attributes["success"].Value.toBool();
		WA_ValidationResult.ErrorOccured = MainNode.Attributes["error"].Value.toBool();
		WA_ValidationResult.Timing = MainNode.Attributes["timing"].Value.toDouble();		
		WA_ValidationResult.ParseData = MainNode.SelectNodes("parsedata")[0].InnerText;
		WA_ValidationResult.Assumptions = new List<WolframAlphaAssumption>();


		foreach (XmlNode Node in MainNode.SelectNodes("assumptions")) {
			System.Threading.Thread.Sleep(1);

			WolframAlphaAssumption Assumption = new WolframAlphaAssumption();

			Assumption.Word = Node.SelectNodes("word")[0].InnerText;

			XmlNode SubNode = Node.SelectNodes("categories")[0];


			foreach (XmlNode ContentNode in SubNode.SelectNodes("category")) {
				System.Threading.Thread.Sleep(1);

				Assumption.Categories.Add(ContentNode.InnerText);

			}

			WA_ValidationResult.Assumptions.Add(Assumption);

		}

		return WA_ValidationResult;

	}