X-QUERY

I have the following DTD for the XML documents that I stored in Tamino.
How can I write a query like the following in X-Query?

“List the names of persons and the number of items they bought”
























<!ATTLIST item id ID #REQUIRED
featured CDATA #IMPLIED>