XPath queries in the form //foo/@bar fail due to the way that result sets are created. I've added unit tests that expose the issue.
This has been partially fixed. I'm unsure though if a collection should be seen as a virtual document for these types of functions. The current solution provides a result from each document.
Fixed: If query results in an attribute, attribute is added to the <result> element.