I found it... Part of the codes come from this site http://social.msdn.microsoft.com/forums/en-US/sharepointcustomizationlegacy/thread/403e6f25-ff23-472c-b414-c17866607181
Just if someone is looking for this my codes look like this:
// Get the name for the InfoPath titlestring selectedXMLFile = MainDataSource.CreateNavigator().SelectSingleNode(
"/my:myFields/my:Title1", NamespaceManager).Value;
// Get the datestring selectedDate = MainDataSource.CreateNavigator().SelectSingleNode(
"/my:myFields/my:Date", NamespaceManager).Value;
// Retrieve the data connection FileQueryConnection con = (FileQueryConnection)DataConnections["items"];
// Change the location of the data connection to point to the XML file created
con.FileLocation = @"Server/_vti_bin/owssvr.dll"
+
"?Cmd=Display&List={GUID}"
+
"&XMLDATA=TRUE&noredirect=true&FilterField1=Training&FilterValue1="+ selectedXMLFile + " - " + selectedDate + ".xml";
// Query the data connection to populate the InfoPath drop-down list box with items
con.Execute();
// Retrieve a reference to the Main DOMXPathNavigator root = MainDataSource.CreateNavigator();
// Count the amount of group2 nodesXPathNodeIterator iter = root.Select("/my:myFields/my:gpContacts/my:gpContact",
NamespaceManager);
int group2NodesCount = iter.Count;
// Retrieve the first group2 nodeXPathNavigator firstGroup2NodeNav =root.SelectSingleNode("/my:myFields/my:gpContacts/my:gpContact[1]",
NamespaceManager);
// Retrieve the last group2 nodeXPathNavigator lastGroup2NodeNav =
root.SelectSingleNode(
"/my:myFields/my:gpContacts/my:gpContact[" +group2NodesCount.ToString() + "]",
NamespaceManager);
// Delete the range of nodes from the first to the last group2 nodes
firstGroup2NodeNav.DeleteRange(lastGroup2NodeNav);