Hi,

The BaseX 7.0.2 handling of fn:element-with-id seems wrong to me. 
BaseX seems to treat attributes named id as ids - fair enough, I guess it has no id elements.

http://www.w3.org/TR/xpath-functions-30/#func-element-with-id says:
The effect of this function is identical to fn:id in respect of elements that have an attribute with the is-id property.
so given:
let $xml :=document{
<a id="0">
  <b id="1" >f</b>
  <b id="2"><g id="2.1">hello</g></b>
  <b xml:id="3">goodbye</b>
</a>
}
I would expect $xml/id("1") and  $xml/element-with-id("1") to both return <b id="1">f</b> .

------result--------------------------------------------------------
<b id="1">f</b>
 ----
 <a id="0">
  <b id="1">f</b>
  <b id="2">
    <g id="2.1">hello</g>
  </b>
  <b xml:id="3">l</b>
</a>
---------------------------
/Andy