HOW we can read data that is stored in xml filein cq5.
Scenario is that i have some data in another system and i a getting that data through a xml file . now i need to read that data fromthat file and at the same time i have to store that in jcr repository. Please help me how to achieve this
You can write a Java service (OSGI service) which reads your XML data and using JCR API's create corresponding nodes (with all data and properties) inside CRX repository. Once you have all the data - you can read this anywhere on your pages(websites, widgets, etc).
One possiblity (depending on the format of the XML) is to use the importer framework. For RSS there is an out of the box solution that is used by the Social Collob - Blog tool - see http://dev.day.com/docs/en/cq/current/administering/social_collaboration.html#Importing Other Blogs by using Feeds.
You can also implement your own importers using an implementation of the importer interface - http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/polling/importer/Importer.html. I don't any examples and it's not something I have done personally, but I know it can be done.