<Roots>
<Names>
<Name>Venkat</Name>
</Names>
</Roots>
CREATE COMPUTE MODULE POC_MF_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE Names INTEGER 1;
DECLARE rInputMessage REFERENCE TO InputRoot.XMLNSC.Roots.Names;
DECLARE stren INTEGER LENGTH(rInputMessage.Name);
SET stren = stren + 1;
DECLARE strlenmul INTEGER ;
Set strlenmul = stren;
WHILE Names < strlenmul DO
SET Environment.Variables.Names[Names] = SUBSTRING(rInputMessage.Name from stren - 1);
Set rInputMessage.Name = SUBSTRING(rInputMessage.Name BEFORE Environment.Variables.Names[Names]);
Set stren = stren - 1;
SET Names = Names +1;
END WHILE;
DECLARE rOutputroot REFERENCE TO Environment.Variables.Names[1];
WHILE LASTMOVE(rOutputroot) DO
SET Environment.Varibale.output = COALESCE(Environment.Varibale.output,'')||rOutputroot;
MOVE rOutputroot NEXTSIBLING REPEAT TYPE NAME;
END WHILE;
SET OutputRoot.XMLNSC.Message.ReverseString = Environment.Varibale.output;
RETURN TRUE;
END;
END MODULE;