My guess is that this could probably be done, but I'm sure it will involve incredibly complex CAML commands. My suggestion would be to download the SharePoint SDK and spend a couple hours digging through the CAML documentation. If you need a little help getting started with CAML you can see this HowTo that explains how to use it to add contacts to a SharePoint list:
http://infopathdev.com/howto/tutorials/default.aspx?i=7bc880f391b84ea9b3b45c6fbecc07c6
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge