Hi,
For XPath Query in crx you can use the following syntax to get the pages ordered by cq:lastmodified.
/jcr:root/content//element(*, cq:Page)
order by cq:lastModified
Please refer the following documentation for more info.
https://docs.adobe.com/docs/en/cq/5-6-1/dam/customizing_and_extendingcq5dam/query_builder.html