Populate Child Table with Data from XML programatically in Pre Processor extension.

We have a content type which has ‘sys_Table’ fields in it. When creating the content Item for this Content Type, users can upload an xml file and I need to read the file and populate the Table fields with the data from xml. I wrote a pre processor extension (of type PSFileInfo) and parsing the XML and setting the values of normal fields like below

paramIPSRequestContext.setParameter(“field_name”, “value”); which is working fine.

But for the type ‘sys_Table’ fields, I am running into issues (XML can be uploaded nly on editing of content item, so that the parent Item is already created). I am using the API to create child entries like below in the “preProcessRequest” method of the extension. It is not working and going into infinite loop. Any pointers on how to achieve this? Thanks for the help!

[I]PSGuidManagerLocator.getGuidMgr();
initServices();

PSCoreItem coreItem = loadItem(contentId);

PSComponentSummary summ = PSOItemSummaryFinder.getSummary(contentId);
PSLocator loc = PSOItemSummaryFinder.getCurrentOrEditLocator(contentId);

cid = gmgr.makeGuid( loc);

List<PSItemChildEntry> toBeSaved = new ArrayList<PSItemChildEntry>();

List<PSItemChildEntry> newEntrie1 = cws.createChildEntries(cid, “body_items”, 1);
// update the child fields here
RxItemUtils.setFieldValue(newEntrie1.get(0),“item_title” ,“kk_item_title1”);
RxItemUtils.setFieldValue(newEntrie1.get(0),“item_body” ,“kk_item_body1”);

toBeSaved.addAll(newEntrie1);

cws.saveChildEntries(cid,“body_items”,toBeSaved);[/I]