This is new for me so I need help to complete this task. Will u help me to get a working example?
Well, I've given you a heads up with regard to DOMDocument. Alternatively you could use SImpleXML or a number of other libraries/classes. You just need an XML parser.
I managed it in 12 lines of code, so it's not that difficult. Have a search for "XML parsing in PHP" or "XML reader PHP". If you are serious about programming, then this kind of research will be your bread and butter for the next few years. If you refuse to help yourself at this early stage, then programming is not for you.