There is an easy way for this Wayne, You need to maintain a variable in InfoPath's secondary dataconnection and filter your data based on that.
As Per your example if "John Doe" is pulled up in the app you will put this value in the secondary xml.
Once you put the value in the secondary xml its all InfoPath's work to filter the data in the UI. For filtering go to the properties of your Repeating Section/Table, Go to display tab. Here you will have button for filtering, clicking on it a dialog box appears where you can ad filters.
If you want to do the same thing it VB, you need to pull out the Nodes (with help of xpath) which have "John Doe" and put them in the InfoPath's data connection(XML) which is mapped to the UI.
Hope this Helps!
Agni
InfoPathDev India