Like Yukas said, you could rewrite the SP as a UDF.
Another alternative would be to keep your SP, but revise it to use a table variable instead of a temp table.
If your values for the xp_logininfo parameters will change, then I'd rewrite the SP as a UDF.