title: XQuery while using distinct-values()
body: <p>XML File </p>
  
  <pre><code>&lt;Cities&gt;
    &lt;Place&gt;
      &lt;City n="New Delhi"&gt;&lt;/City&gt;
      &lt;City n="Chandigarh"&gt;&lt;/City&gt;
      &lt;City n="Mumbai"&gt;&lt;/City&gt;
    &lt;/Place&gt;
    &lt;Place&gt;
      &lt;City n="New Delhi"&gt;&lt;/City&gt;
      &lt;City n="Chandigarh"&gt;&lt;/City&gt;
    &lt;/Place&gt;
    &lt;Place&gt;
      &lt;City n="New Delhi"&gt;&lt;/City&gt;
      &lt;City n="Mumbai"&gt;&lt;/City&gt;
    &lt;/Place&gt;
  &lt;/Cities&gt;
  </code></pre>
  
  <p>I am using following XQuery -</p>
  
  <pre><code>for $x in doc("sample")/Cities/Place/City
     order by $x/@n
     return distinct-values($x/@n)
  </code></pre>
  
  <p>The result I am expecting is -
      <code>Chandigarh Mumbai New Delhi</code></p>
  
  <p>but getting -
      <code>Chandigarh Chandigarh Mumbai Mumbai New Delhi New Delhi New Delhi</code></p>
  
  <p>Please tell me where am I going wrong?</p>