Removed superfluous <ref> elements around <note>s

and new, more efficient XQuery extraction thanks to Wendell Piez :-)