---
title: "Run query with XML data best practice"
slug: "run-query-with-xml-data-best-practice"
tags: ["Product Usage", "ePolicy Orchestrator – On-prem", "ePO 5.10.x", "ePO 5.10.0"]
updated: 2026-09-07T17:47:05Z
published: 2026-09-07T17:47:05Z
canonical: "docs.trellix.com/run-query-with-xml-data-best-practice"
---
> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trellix.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Run query with XML data best practice
Exporting existing query XML definitions is a great way to learn how to create web URL queries.
In this example, export the "VSE: DAT Deployment XML" definition file and use those table objects to create a list of the Threat Prevention DAT file versions for each system in your network.
1. Export the existing query definition XML file and open it in a text editor.
Your export files look similar to this VSE: DAT Deployment XML definition file.
```
VSE: DAT Deployment
Displays the three highest DAT versions, and a slice for all the other versions.
EPOLeafNode
query:table?orion.table.columns=EPOComputerProperties.ComputerName%3AEPOComputerProperties.DomainName%3AEPOLeafNode.os%3AEPOComputerProperties.Description%3AEPOLeafNode.Tags%3AEPOProdPropsView_VIRUSCAN.productversion%3AEPOProdPropsView_VIRUSCAN.hotfix%3AEPOProdPropsView_VIRUSCAN.servicepack%3AEPOProdPropsView_VIRUSCAN.enginever%3AEPOProdPropsView_VIRUSCAN.enginever64%3AEPOProdPropsView_VIRUSCAN.datver%3AEPOLeafNode.LastUpdate&orion.table.order.by=EPOComputerProperties.ComputerName%3AEPOComputerProperties.DomainName%3AEPOLeafNode.os%3AEPOComputerProperties.Description%3AEPOLeafNode.Tags%3AEPOProdPropsView_VIRUSCAN.productversion%3AEPOProdPropsView_VIRUSCAN.hotfix%3AEPOProdPropsView_VIRUSCAN.servicepack%3AEPOProdPropsView_VIRUSCAN.enginever%3AEPOProdPropsView_VIRUSCAN.enginever64%3AEPOProdPropsView_VIRUSCAN.datver%3AEPOLeafNode.LastUpdate&orion.table.order=az
query:condition?orion.condition.sexp=%28+where+%28+version_ge+EPOProdPropsView_VIRUSCAN.productversion+%228%22+%29+%29
query:summary?pie.slice.title=EPOProdPropsView_VIRUSCAN.datver&pie.count.title=EPOLeafNode&orion.query.type=pie.pie&orion.sum.query=true&orion.sum.group.by=EPOProdPropsView_VIRUSCAN.datver&orion.sum.order=desc&orion.show.other=true&orion.sum.aggregation=count&orion.sum.aggregation.showTotal=true
```
2. Open an existing web URL query file to use as a template, then save it with a new name. For example, `URL_template`.
Following is an example of an existing web URL template file.
```
https://:8443/remote/core.executeQuery?
target=&
select=(select )
```
3. From the query definition XML file, find the query target listed between the target tags.
For example, `<target>EPOLeafNode</target>` and paste the target table name in `target=` of your template URL.
This is the template the URL with the target table name added.
```
https://:8443/remote/core.executeQuery?
target=EPOLeafNode&
select=(select )
```
4. From the query definition XML file, find the S-Expression function, listed between the opening and closing `<condition-uri> ... </condition-uri>` tags, then perform these steps:
1. In the URL template file, paste the object names in the `select=(select` parameter and the closing parenthesis. This example adds the EPOLeafNode.NodeName (system name) and EPOProdPropsView_VIRUSCAN.datver (VirusScan Enterprise DAT version) from the EPOLeafNode (System Tree) table.
```
https://:8443/remote/core.executeQuery?
target=EPOLeafNode&
select=(select EPOLeafNode.NodeName EPOProdPropsView_VIRUSCAN.datver)
```
2. Add the sort order function. For example, to sort the output by system name, add the string "`& order=(order(desc EPOProdPropsView_VIRUSCAN.datver)`" in the existing S-Expression.
The following example sorts the output by the Threat Prevention DAT version.
```
https://:8443/remote/core.executeQuery?
target=EPOLeafNode&
select=(select EPOLeafNode.NodeName EPOProdPropsView_VIRUSCAN.datver&
order=(order(asc EPOProdPropsView_VIRUSCAN.datver))
```
5. Replace the `<localHost>` variable with your ePO - On-prem server DNS name, or IP address and paste the URL in your browser address bar. Your output should be similar to this output, but with many entries.
```
OK:
System Name: DP-2K12R2S-SRVR
DAT Version (VirusScan Enterprise):
System Name: DP-EN-W7E1XP-2
DAT Version (VirusScan Enterprise):
System Name: DP-W7PIP-2
DAT Version (VirusScan Enterprise): 7429.0000
System Name: DP-W7PIP-1
DAT Version (VirusScan Enterprise): 7437.0000
.
.
.
```
6. (Optional) To have the information appear in table format, paste the string `:output=terse&` before any ampersand in the URL and rerun the command. This is an example of your template file with `:output=terse&` added.
```
https://:8443/remote/core.executeQuery?target=EPOLeafNode&:output=terse&select=(select EPOLeafNode.NodeName EPOProdPropsView_VIRUSCAN.datver)&
order=(order(desc EPOLeafNode.NodeName))
```
Confirm that your output is similar to the following example.
```
OK:
System Name DAT Version (VirusScan Enterprise)
--------------- ----------------------------------
DP-2K12R2S-SRVR
DP-EN-W7E1XP-2
DP-W7PIP-2 7429.0000
DP-W7PIP-1 7437.0000
DP-2K8AGTHDLR 7437.0000
DP-2K8ER2EPO510 7465.0000
DP-W7PIP-3 7465.0000
.
.
.
```
You have created a web URL query using the information exported from an existing XML query definition.