title: Is it possible to compare element values of a document on search in marklogic
body: <p>I want to understand if marklogic has the ability to compare element values within a single document while performing a search i.e. cts:search.</p>
  
  <p>For eg:</p>
  
  <p>Consider a document as below</p>
  
  <pre><code>&lt;root&gt;
      &lt;someTags&gt;&lt;/someTags&gt;
      .
      .
      .
      &lt;effectivePeriod&gt;
          &lt;dateTimeBegin&gt;2009-01-16T00:00:00-05:00
          &lt;/dateTimeBegin&gt;
          &lt;dateTimeEnd&gt;2009-01-16T00:00:00-05:00
          &lt;/dateTimeEnd&gt;
      &lt;/effectivePeriod&gt;
      .
      .
      .
      &lt;otherTags&gt;&lt;/otherTags&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Let's imagine that there are a hundred thousand documents like the one above. How can I make a search that ensures I only pick up documents where the effectivePeriod.dateTimeEnd > effectivePeriod.dateTimeBegin?</p>