Sure thing. If the Web Service is used as your main DOM (via New form from Data Connection -> Web Service), then you should be able simply add XDocument.Query() to the OnLoad event handler as mentioned above. To do this Chooose Programming | On Load Event from the Tools Menu and type XDocument.Query() into the function that is generated in the Microsoft Script Editor.
If you are using a Web Service (or any other data connection ) as a secondary data source you will have to use a slightly more specific code snippet:
var webService = XDocument.DataObjects( "Name of your Data Connection" );
webService.Query();
If you have not downloaded the InfoPath SDK (which is where all of this information came from), I would highly recommend it. A link can be found on the left side of this page.
Hope this helps, let us know if you have any more questions!
---------------
Matt Faus
InfoPath Dev Texas
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge