title: how to read xml file in xquery
body: <p>I am trying to read an xml file using XQuery.
      On trying a lot in google what all I found relevant is doc() function. But it is not working for me.
      I have kept my xml file and Xquery under same folder in eclipse. But Xquery is giving error: line 13, column 6: {err}XP0004: Invalid static type: untypedDocument? </p>
  
  <pre><code>My Xquery:
  
  
       declare function xf:LookupXML($dvm1 as element(ns0:dvm),
          $DVMName as element(*),
          $SourceColumn as element(*))
          as element(*) {
               doc('CityCode.xml')     
      };
  
      declare variable $dvm1 as element(ns0:dvm) external;
      declare variable $DVMName as element(*) external;
      declare variable $SourceColumn as element(*) external;
  
      xf:LookupXML($dvm1,
          $DVMName,
          $SourceColumn)
  
  My xml file:- Name- CityCode.xml
  
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;tns:dvm name="" xmlns:tns="http://www.example.org/SuburbCode" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/SuburbCode SuburbCode.xsd "&gt;
    &lt;tns:columns&gt;
      &lt;tns:column name="City"/&gt;
      &lt;tns:column name="Code"/&gt;
    &lt;/tns:columns&gt;
    &lt;tns:rows&gt;
      &lt;tns:row&gt;
        &lt;tns:cell&gt;Mumbai&lt;/tns:cell&gt;
        &lt;tns:cell&gt;BOM&lt;/tns:cell&gt;
      &lt;/tns:row&gt;
       &lt;tns:row&gt;
        &lt;tns:cell&gt;Delhi&lt;/tns:cell&gt;
        &lt;tns:cell&gt;DLH&lt;/tns:cell&gt;
      &lt;/tns:row&gt;
       &lt;tns:row&gt;
        &lt;tns:cell&gt;Banglore&lt;/tns:cell&gt;
        &lt;tns:cell&gt;BLR&lt;/tns:cell&gt;
      &lt;/tns:row&gt;
    &lt;/tns:rows&gt;
  &lt;/tns:dvm&gt;
  
  
  If anyone knows please provide solution.
  </code></pre>