Hello Welcome to the Forums,
We can you populate the form data from data source using the below code,
IXMLDOMDocument2 secondaryDOM = thisXDocument.GetDOM("Secondary Data Source Name");
secondaryDOM.setProperty("SelectionNamespaces", "<Namespace of your secondary dom>");
//Get the node from secondary dom
IXMLDOMNode secondaryDOMNode = secondaryDOM.selectSingleNode("XPath of your field");
//Get the value from above node
string secondaryDOMNodeValue = secondaryDOMNode.text;
//To set the above value to main dom field
thisXDocument.DOM.selectSingleNode("XPath of the field").text = secondaryDOMNodeValue;
Here we can save the form. I am not getting save the image by programatically?