I think it is good idea make a function returning set of records, like xpath_table, but accepting xml data in a text paramiter. Today if you have a function with a xml parameter, you have to save it in a table to use xpath.
Thanks,