/// <summary>
 /// Returns the last expression tree executed.
 /// </summary>
 /// <returns>The expression tree executed serialized into XML.</returns>
 public static XmlDocument GetLastExpressionTreeXml()
 {
     return(ExpressionTreeToXmlSerializer.SerializeToXml(GetLastQueryable().Expression));
 }
        /// <summary>
        /// Create a TestWebRequest using <paramref name="dataServiceType"/> and <paramref name="uri"/>.
        /// Execute the request and extract the IQueryable generated from the service, then serialize the expression tree into XML
        /// </summary>
        /// <param name="dataServiceType">The context type for the service</param>
        /// <param name="uri">The uri for this request</param>
        /// <returns>An XmlDocument object serialized from the Queryable for this request</returns>
        public static XmlDocument CreateRequestAndGetExpressionTreeXml(Type dataServiceType, string uri)
        {
            IQueryable queryable = CreateRequestAndGetQueryable(dataServiceType, uri);

            return(ExpressionTreeToXmlSerializer.SerializeToXml(queryable.Expression));
        }