title: Not getting correct output in xquery
body: <p>I am using 2 xml files-"Department.xml" and "Employee.xml".</p>
  
  <p><strong>Department.xml</strong></p>
  
  <pre><code>    &lt;DeptList xsi:noNamespaceSchemaLocation="officeSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;Department&gt;
      &lt;deptName&gt;mech&lt;/deptName&gt;
      &lt;deptNo&gt;module1&lt;/deptNo&gt;
      &lt;deptManagerSSN&gt;31001&lt;/deptManagerSSN&gt;
      &lt;deptManagerStartDate&gt;2013-01-26&lt;/deptManagerStartDate&gt;
      &lt;deptLocation&gt;near xyz road&lt;/deptLocation&gt;
  &lt;/Department&gt;
  &lt;Department&gt;
      &lt;deptName&gt;it&lt;/deptName&gt;
      &lt;deptNo&gt;module2&lt;/deptNo&gt;
      &lt;deptManagerSSN&gt;32001&lt;/deptManagerSSN&gt;
      &lt;deptManagerStartDate&gt;2013-04-15&lt;/deptManagerStartDate&gt;
      &lt;deptLocation&gt;near wt road&lt;/deptLocation&gt;
  &lt;/Department&gt;
      &lt;/DeptList&gt;
  </code></pre>
  
  <p><strong>Employee.xml</strong></p>
  
  <pre><code>    &lt;EmpList xsi:noNamespaceSchemaLocation="officeSchema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  &lt;Employee&gt;
      &lt;empName&gt;Ramesh&lt;/empName&gt;
      &lt;empSSN&gt;31001&lt;/empSSN&gt;
      &lt;empSex&gt;Male&lt;/empSex&gt;
      &lt;empSalary&gt;57000&lt;/empSalary&gt;
      &lt;empBirthDate&gt;1988-03-12&lt;/empBirthDate&gt;
      &lt;empDeptNo&gt;module1&lt;/empDeptNo&gt;
      &lt;empSupervisorSSN&gt;31001&lt;/empSupervisorSSN&gt;
      &lt;empAddress&gt;3-f, x.y.z colony&lt;/empAddress&gt;
      &lt;empWorksOn&gt;proj01&lt;/empWorksOn&gt;
  &lt;/Employee&gt;
  &lt;Employee&gt;
      &lt;empName&gt;Raj&lt;/empName&gt;
      &lt;empSSN&gt;31002&lt;/empSSN&gt;
      &lt;empSex&gt;Male    &lt;/empSex&gt;
      &lt;empSalary&gt;40000&lt;/empSalary&gt;
      &lt;empBirthDate&gt;1989-03-30&lt;/empBirthDate&gt;
      &lt;empDeptNo&gt;Module1&lt;/empDeptNo&gt;
      &lt;empSupervisorSSN&gt;31001&lt;/empSupervisorSSN&gt;
      &lt;empAddress&gt;6-A, w.t.c. colony
      &lt;/empAddress&gt;
      &lt;empWorksOn&gt;proj01&lt;/empWorksOn&gt;
  &lt;/Employee&gt;
     &lt;/EmpList&gt;
  </code></pre>
  
  <p>What I want is, if "deptManagerSSN" is equal to "empSSN" then print the "empName" else print "deptName". For this I have written the following query:</p>
  
  <pre><code>    for     $x in doc("C:/Users/Abhay/labWork/Department.xml")/DeptList/Department, 
              $y in doc("C:/Users/Abhay/labWork/Department.xml")/EmpList/Employee 
      return if(data($x/deptManagerSSN)=data($y/empSSN))
      then &lt;text1&gt;{data($y/emptName)}&lt;/text1&gt; 
      else &lt;text1&gt;{data($x/deptName)}&lt;/text1&gt;
  </code></pre>
  
  <p>But I am not getting any output. I am not getting any error also. Please tell where I am going wrong in query.
  I am using "xml editix" as the xml engine.
  Sorry, if my question is silly, I am new in xml.</p>