I have a list of XML files, which needs to be parsed using MR code.
A sample of the xml file is give below
<tns:envelope xmlns:tns="http://abcd.com/schemas/envelope/v3_0" xmlns:xsi="http://www.abcd.org/2001/XMLSchema-instance" version="3.0">
<tns:header>
<tns:type>response</tns:type>
<tns:service>
<tns:name>Value1</tns:name>
<tns:version>3.0</tns:version>
</tns:service>
<tns:originator>Value2</tns:originator>
<tns:businessProcessName>Value3</tns:businessProcessName>
<tns:sequenceNumber>value3</tns:sequenceNumber>
<tns:transactionReference>abcdef12345</tns:transactionReference>
<tns:expirationSeconds>1200</tns:expirationSeconds>
<tns:additionalParameters>
<tns:param>
<tns:name>notificationURL</tns:name>
<tns:value>https://url1</tns:value>
</tns:param>
<tns:param>
<tns:name>ConsumingCallbackURL</tns:name>
<tns:value>https://url2</tns:value>
</tns:param>
</tns:additionalParameters>
<tns:result>
<tns:status>success</tns:status>
<tns:provider>ABC</tns:provider>
</tns:result>
<tns:requestDateTime>2016-02-16T08:12:17.827Z</tns:requestDateTime>
</tns:header>
<tns:body></tns:body>
</tns:envelope>
Now I have a configuration file where the interested tags which needs to be parsed are kept. Sample tag names given like below
/envelope/version
/envelope/header/type
/envelope/header/service/name
/envelope/header/additionalParameters/param/name
/envelope/header/additionalParameters/param/value
The expected output will is like below
/envelope/version /envelope/header/type /envelope/header/service/name /envelope/header/additionalParameters/param/name /envelope/header/additionalParameters/param/value
3.0 response Value1 notificationURL https://url1
3.0 response Value1 ConsumingCallbackURL https://url2
Can I get a sample code to parse the XML and get the sample desired output.