Use <iq>'s to set up a connection, and XEP-0047 for the data.