Fetch all xmpp user list

Hi, Can any one please sugget me a good way to fetch the lists of all xmpp users programatically. I’m looking for a decent way like XML/Text output. Although I know users can be fetched from the ofUser ‘table’, but if there is already some plugin available then please suggest.

Thank you!

Muhammad Faheem