A: 

A simple regular expression might be sufficient in this case:

import re

f = open('your_file.xml')
try:
    xml = f.read()
    xml_with_trim = re.sub(r'(CDATA\[)([A-Z_]+)(\]\])', r'\1TRIM(\2)\3', xml)
    print xml_with_trim
finally:
    f.close()

The column name is matched using '[A-Z_]+' regex i.e., one or more capital letters or '_'. See documentation for the re module.

J.F. Sebastian
i dont know why but this is not working its still showing me the same result with no trim added ,i used the same code as shown above. Any other way. Thanks for your help
kdev