The id() function in XQuery selects nodes that, in the language of the XDM data model, have the "is-id" property. In practice a node can be given this property in three ways:
* by declaring an attribute of type ID in a DTD
* by declaring an element or attribute of type xs:ID in the schema
* by naming an attribute xml:id.
The fact that your elements are named <id> does not give them this property, or make them special in any other way. So you select them and process them exactly as you would an element called foo.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference