Another way of creating XML feeds from Sage CRM is to use the XML property of the COM Record object.

The XML property is available in all currently supported releases of Sage CRM.

Example Usage

var myRecord = CRM.FindRecord("person","pers_companyid=24");
Response.Expires=-1;
Response.ContentType = "text/xml"

while (!myRecord.eof) //eof checks for end of data and instantiates query
{
Response.Write(myRecord.XML);
  myRecord.NextRecord();
}

This would return a result that looked like

<person>
  <personid>26</personid>
  <companyid>24</companyid>
  <primaryaddressid>33</primaryaddressid>
  <primaryuserid>6</primaryuserid>
  <salutation>Mr.</salutation>
  <firstname>Arnold</firstname>
  <lastname>Ball</lastname>
  <middlename></middlename>
  <suffix></suffix>
  <gender>Male</gender>
  <title>Chief Executive</title>
  <titlecode>CEO</titlecode>
  <department></department>
  <status></status>
  <source></source>
  <territory></territory>
  <website></website>
  <mailrestriction></mailrestriction>
  <phonecountrycode>1</phonecountrycode>
  <phoneareacode>617</phoneareacode>
  <phonenumber>742-3677</phonenumber>
  <emailaddress>aball@swforge.com</emailaddress>
  <faxcountrycode>1</faxcountrycode>
  <faxareacode>617</faxareacode>
  <faxnumber>742-3678</faxnumber>
  <createdby></createdby>
  <createddate>2009-01-06T15:01:00.000</createddate>
  <updatedby>1</updatedby>
  <updateddate>2009-01-06T15:01:00.000</updateddate>
  <timestamp>1899-12-30T00:00:00.000</timestamp>
  <deleted></deleted>
  <librarydir></librarydir>
  <segmentid></segmentid>
  <channelid></channelid>
  <uploaddate>1899-12-30T00:00:00.000</uploaddate>
  <secterr>-2147483638</secterr>
  <workflowid></workflowid>
  <accountid></accountid>
  <intforeignid></intforeignid>
  <intid></intid>
  <intlastsyncdate>1899-12-30T00:00:00.000</intlastsyncdate>
  <promote></promote>
  <conflictresdate>1899-12-30T00:00:00.000</conflictresdate>
</person>

The XML property describes the data in the returned row as XML.  The XML would be repeated if more rows were in the record set.

Note.

This will work for custom for entities but for all entities the prefix on the column names for the table must be exactly 4 characters long.  This is a preset value assumed in the dll. 

Please see the article "Creating XML feeds from Sage CRM".  The article provides an include file for helping create XML feeds.  It also discusses the return of XML using a query object.