public XDocument BuildComplexDataQuery(IComplexDataQuery query)
        {
            var queryMessageType = new DataQueryType();

            queryMessageType.Header = new BasicHeaderType();
            V21Helper.SetHeader(queryMessageType.Header, null);

            var queryType = new Org.Sdmx.Resources.SdmxMl.Schemas.V21.Query.DataQueryType();

            var coreBuilder = new ComplexDataQueryCoreBuilderV21();
            coreBuilder.FillDataQueryType(queryType, query);
            queryMessageType.BaseDataQueryType = queryType;
            var queryMessageDocument = new StructureSpecificDataQuery(queryMessageType);

            return new XDocument(queryMessageDocument.Untyped);
        }
        public XDocument BuildComplexDataQuery(IComplexDataQuery query)
        {
            var queryMessageDocument = new GenericTimeSeriesDataQuery(new GenericTimeSeriesDataQueryType());

            queryMessageDocument.Content.Header = new BasicHeaderType();
            V21Helper.SetHeader(queryMessageDocument.Content.Header, null);

            var queryType = new DataQueryType();
            var coreBuilder = new ComplexDataQueryCoreBuilderV21();
            coreBuilder.FillDataQueryType(queryType, query);
            queryMessageDocument.Content.BaseDataQueryType = queryType;
            
            var xDocument = new XDocument(queryMessageDocument.Untyped);

            return xDocument;

        }