I have tried this
select xpath('name()', unnest(xpath('/foo/*', '<foo><bar>test</bar><zar>test1</zar></foo>')));
As suggested in other question here, but I just get two empty rows as response.
In addition I have tried
select unnest(xpath('name(/foo/*)', '<foo><bar>test</bar><zar>test1</zar></foo>'));
But it returns only one row with response as bar.
Is there anyway I could get the query to return two rows with result bar, zar using Xpath?