# Configuring XML File Queries

Learn about configuring an XML file query on the Configure XML Queries screen.

## Content

### General

Once you have configured a valid [XML File data source](/activereportsnet/docs/v20.1/report-authors/using-report-wizard/configuring-data-source/file-data-source), the **Configure XML Queries** screen allows you to add one or more queries to the XML data contained in the file.
![Configure XML Queries](https://cdn.mescius.io/document-site-files/images/b298aea2-8cb8-4a0f-be88-4f54aa263ebd/images/configure-xml-queries.png)

### Adding and Removing Queries

You can add and remove Queries by using the **Add** and **Remove** buttons below the list on the left side of the screen. At least one query is required to complete proceed to the next steps.

### Configuring Queries

Each query has the **Name** property that is the unique ID of the query and the **Path** property that is a [XPath expression](https://en.wikipedia.org/wiki/XPath) that is used to select the repeating nodes from the XML data to visualize them in a report.

You can set the XPath in the XML data tree by clicking the corresponding node, or you can enter the **XPath expression** manually in the **Query** textbox. Here are several examples of XPath Expressions.

* To select all child nodes of the root element, you can use the expression **/\*/\***, which will select all elements at the second level of the XML document.
* To select data from a specific element, such as selecting all **\<Order>** elements under **\<Customer>**, you can use an expression like **/Customers/Customer/Orders/Order**.
* To filter data by a specific attribute, such as selecting only orders with a status of **Completed**, you can use an expression like **/Customers/Customer/Orders/Order[@status='Completed']**.
* To select elements containing specific text, such as selecting customers in the USA, you can use an expression like **/Customers/Customer[address/country='USA']**.

For more details on XPath syntax, you can refer to the official [XPath specification](https://www.w3.org/TR/xpath-31/).

### Dynamic queries

You could also make a query dynamic by using parameters in the path expression. Parameters are dynamic values that are either supplied programmatically via your application's code or provided by the report reader through user input. To insert a parameter into an XPath expression, click the **Insert parameter...** link below the **Query** textbox. The **Parameters** dialog will appear:

![Configure Parameters for XML Query](https://cdn.mescius.io/document-site-files/images/b298aea2-8cb8-4a0f-be88-4f54aa263ebd/images/configure-xml-queries-parameters.png)

Here, you can re-use an existing parameter or create a new one by clicking the **Add** button. The following parameter properties can be configured:

* **Name**: The parameter name used as a reference in query. You’ll need this name to supply its value via code if you choose to do so.
* **Type**: The data type of the parameter. You can select from **Boolean**, **DateTime**, **Integer**, **Float**, and **String**.
* **Testing Value**: The value used at design-time to test the query.
* **Input Source**: Choose **Programmatic** to supply the parameter values via your application code, or **Interactive** to allow report readers to provide the parameter values.

Once you click the **OK** button, the reference to the selected parameter will be inserted into the path expression. For example, it will be updated to **/Customers/Customer[address/country={country}]**, which filters the data by country using a dynamic value.

### Next steps

Once you have configured one or more queries, click **Finish >>** to create a report with data binding configured, or click **Next >** to add a [data display control](/activereportsnet/docs/v20.1/report-authors/using-report-wizard/configuring-report-controls).