title: How do I find duplicate data in xml document using XQuery?
body: <p>I have a bunch of documents in a MarkLogic xml database. One document has:</p>
  
  <pre><code>&lt;colors&gt;
    &lt;color&gt;red&lt;/color&gt;
    &lt;color&gt;red&lt;/color&gt;
  &lt;/colors&gt;
  </code></pre>
  
  <p>Having multiple colors is not a problem. Having multiple colors that are both red is a problem. How do I find the documents that have duplicate data?</p>