This would be a great feature to have, thanks.
I've had a quick look over the code, looks fine. Only one small thing, you need to free(id) after setting it in the stanza xmpp_stanza_set_id(iq, id) as this function allocates it's own memory for a copy. You can see an example in stanza_create_message().
Look forward to the pull request, don't hesitate to ask if you have any questions about the remaining implementation.
Thanks,
James.