How to get all elements from XML via XQuery
I need to get all XML elements present in a given file via XQuery. For example,
<xml>
<a>attr="one"
<b>attr2="in-a"
<c>leaf</c>
</b>
</a>
</xml>
the output should return the following:
<xml>,<a>,<b>,<c>
and, if possible, hierarchically. And I only need to use XQuery.
Any help is appreciated. Thank.
+3
source to share