Using MarkLogic but this is probably a generic XQuery question.
I have:
<library>
<books>
<book title="whatever">
<publisher>Random</publisher>
....more children
</book>
<book title="another">
<publisher>Simon</publisher>
....more children
</book>
...
</books>
</library>
I want to return all the [book] elements with their title attributes, but I do NOT want any of the children of book, e.g. [publisher]. How do I accomplish this in an orthodox and performant manner?
Correlated question: at times I may want to get some of the children, but not others, e.g. get all the book elements and their publisher child elements, but none of the other children.
Thanks.