Hi,
Add a Group in the main data source and move all the fields in to that group (ex: group5). After that place the following code in the clear button click event.
[InfoPathEventHandler(MatchPath = "CTRL15_5", EventType = InfoPathEventType.OnClick)]
public void CTRL15_5_OnClick(DocActionEvent e)
{
IXMLDOMNode groupNode = thisXDocument.DOM.selectSingleNode("/my:myFields/my:group5");
IXMLDOMDocument2 sampleDataDom = (IXMLDOMDocument2)thisXDocument.CreateDOM();
sampleDataDom.setProperty("SelectionNamespaces", "<write your form name space>");
sampleDataDom.load("sampledata.xml");
IXMLDOMNode sampleGroupNode = sampleDataDom.selectSingleNode("/my:myFields/my:group5");
IXMLDOMNode groupParentNode = thisXDocument.DOM.selectSingleNode("/my:myFields");
groupParentNode.replaceChild(sampleGroupNode, groupNode);
}
Here group5 -> is the group under which the controls are placed.
myFields -> parent node of group5