title: Restricting XQuery to XPath
body: <p>I've got an app that manages collections of XML files and allows querying using XPath, to allow users to view subsets of collections that match an XPath query.</p>
  
  <p>For various technical reasons, I'm switching to an XQuery engine. I understand that XQuery is a superset of XPath. However, I don't want full XQuery functionality because users may use it to construct new XML objects that don't match my DTD and can't be displayed by my SVG-based viewer.</p>
  
  <p>Can I easily validate query strings as XPath and hand them off to the XQuery engine? Or can I convert them in a simple way?</p>
  
  <p>(I'm using C++ and switching to XQilla.)</p>