So, if you are beyond the basics on XML and are ready to get your hands dirty, this series of labs available on the MSDN site is very good. I especially end up sending people to Lab 15, which does a very good job of showing how InfoPath can reach into Active Directory and retrieve information based on a users's logon. I also reference Lab 14 quite a bit, which guides a user through setting up a custom task pane that changes the help displayed as the user tabs through the sections of a form. Very nice.
https://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_15.asp