how to select attribute value of a node in XQuery? December 11, 2023 by Tarik You should use data to pick attribute value:- for $c in /company/customers/customer return data($c/@cno)