Yes you can do this, here's a short sample:
construct SQLinserterrorMSG
{
// Use the Variable varXMLDom to load in some XML
varXMLDOM.LoadXml(@"<ns0:errormsg xmlns:ns0=""http://SQLinsertErrorMSGsSchema""><ns0:sync><ns0:after><ns0:errormsg …. FileID=""10"" FelTEXT=""errorTEXT_10""/></ns0:after></ns0:sync></ns0:errormsg>");
// Assign the BizTalk message to the XMLDom variable. Note this can be accomplished becuase a BizTalk message derives from an XMLDocument.
SQLinserterrorMSG = varXMLDOM;
// If there are no distinguished fields, then XPATH can be used to set the attributes in the message.
xpath(SQLinsertMSG , "//@FileID") = "99999";
xpath(SQLinsertMSG, //@errorTEXT) = "some text…";
}