SlideShare a Scribd company logo
1 of 16
XML to XML transformation in Mule
As we know, there can be multiple types of payload we need
to deal daily, starting from JSON, XML or String, we also
require different type of data transformation in our application
like XML to JSON, JSON to XML or String etc . In Mule
application, we have a various set of transformers that we
can use to obtain our required data format.
Here we will be discussing on transformation of XML to XML
format of data. If you have gone through my previous slides
on JSON to JSON transformation here , you will realize how
easy it is to perform such type of transformation in Mule.
Here we will take the same example, but will be doing it on
XML instead of JSON this time.
So, let us consider, we have the following XML payload as an
input to our application :-
<RootTag>
<name>Anirban Sen Chowdhary</name>
<id>37</id>
</RootTag>
.
We can see here the XML contains only 2 elements, that is
name and id.
So, now if this XML data is coming as an input and we
require to transform/modify the payload into another XML
format and produce it as an output, something like the
following :-
<RootTag>
<name>Anirban Sen Chowdhary</name>
<id>37</id>
<designation>Director</designation>
</RootTag>
And here you can see the modified XML has a new element
designation as a third element . Now, the challenge here is to
modify the existing input XML payload and to design an
output XML payload from it, which will contain this additional
element in it with the same format.
So, how can we transform/modify the payload into another
XML format in an easy way. We know Mule has extremely
powerful tools called Datamapper but that limited to Mule
enterprise edition.
How to transform or modify a XML payload in
Mule ??
A simple way of doing it is using XSLT in Mule. Mule do have
XSLT support in it’s flow, which makes the life of a developer easy
in transforming/modifying XML in the required format.
So, here is the Mule flow which can be use to transform XML
payload from one format to another using XSLT :-
After that, we are setting the designation variable with a value,
which will be passed into our XSLT, and it will be adding it there
as a node called designation. So, the XML output coming after
XSLT will be the modified/transformed XML containing additional
node called designation.
The XSL file here named as Transform.xsl should be kept under
src/main/resources folder and the xsl file will be as following :-
The graphical representation of this flow will be as follows :-
Testing our application ……
Now, we are done with our coding and will deploy our application
and test it.
Once deployed on Mule server, we can test our application using
RestClient or any other client you wish.
once we click the send button we will get the following response in
our client from our Mule flow :-
Conclusion
So, you can find transforming or modifying a XML payload into
another XML format is extremely easy in Mule using the XSLT .
And that means you can design your output XML payload in any
format you require using XSLT easily in your Mule flow and Mule
also support this by it’s XSLT transformer !!!
That’s all !!! I’ve hopefully been clear enough in displaying the
implementation of XSLT and XSLT transformer in designing and
modifying your XML payload which you can produce as an output
from your Mule application.
I hope you liked this !!!
Hope you enjoyed the simple yet an amazing trick in Mule
You can also find this post here :- http://bushorn.com/xml-to-xml-
transformation-in-mule/
Xml to xml transformation in mule

More Related Content

What's hot (14)

Running mule standalone
Running mule standaloneRunning mule standalone
Running mule standalone
 
Mule batch job
Mule batch jobMule batch job
Mule batch job
 
Mule jms queues
Mule jms queuesMule jms queues
Mule jms queues
 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in Mule
 
Soap request in mule
Soap request in mule Soap request in mule
Soap request in mule
 
Mule soap
Mule soapMule soap
Mule soap
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 
xslt in mule
xslt in mulexslt in mule
xslt in mule
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Mule architecture
Mule   architectureMule   architecture
Mule architecture
 
Scatter gather flow in mule
Scatter gather flow in muleScatter gather flow in mule
Scatter gather flow in mule
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
 

Viewers also liked

Presentation julie n. asuncion
Presentation   julie n. asuncionPresentation   julie n. asuncion
Presentation julie n. asuncionjulieasuncion
 
Slideashare josue
Slideashare josueSlideashare josue
Slideashare josueHerrejim
 
Rådgivningstjenesten
RådgivningstjenestenRådgivningstjenesten
Rådgivningstjenestenkarmanen
 
El país de las hojas sueltas. tomo vi. de la segunda guerra mundial al neoli...
El país de las hojas sueltas. tomo vi. de  la segunda guerra mundial al neoli...El país de las hojas sueltas. tomo vi. de  la segunda guerra mundial al neoli...
El país de las hojas sueltas. tomo vi. de la segunda guerra mundial al neoli...avitiadgo
 
El país de las hojas sueltas. tomo iii. de la revolución maderista al triunfo...
El país de las hojas sueltas. tomo iii. de la revolución maderista al triunfo...El país de las hojas sueltas. tomo iii. de la revolución maderista al triunfo...
El país de las hojas sueltas. tomo iii. de la revolución maderista al triunfo...avitiadgo
 
Perrilaku terpuji
Perrilaku terpujiPerrilaku terpuji
Perrilaku terpujiyaniajhaa34
 

Viewers also liked (12)

Presentation julie n. asuncion
Presentation   julie n. asuncionPresentation   julie n. asuncion
Presentation julie n. asuncion
 
Calameo
CalameoCalameo
Calameo
 
Slideashare josue
Slideashare josueSlideashare josue
Slideashare josue
 
Silabus baru
Silabus baruSilabus baru
Silabus baru
 
Rådgivningstjenesten
RådgivningstjenestenRådgivningstjenesten
Rådgivningstjenesten
 
16 al 22 de noviembre
16 al 22 de noviembre16 al 22 de noviembre
16 al 22 de noviembre
 
Encuadre
EncuadreEncuadre
Encuadre
 
Los volcanes
Los volcanesLos volcanes
Los volcanes
 
El país de las hojas sueltas. tomo vi. de la segunda guerra mundial al neoli...
El país de las hojas sueltas. tomo vi. de  la segunda guerra mundial al neoli...El país de las hojas sueltas. tomo vi. de  la segunda guerra mundial al neoli...
El país de las hojas sueltas. tomo vi. de la segunda guerra mundial al neoli...
 
El país de las hojas sueltas. tomo iii. de la revolución maderista al triunfo...
El país de las hojas sueltas. tomo iii. de la revolución maderista al triunfo...El país de las hojas sueltas. tomo iii. de la revolución maderista al triunfo...
El país de las hojas sueltas. tomo iii. de la revolución maderista al triunfo...
 
Cuadro sinoptico marco conceptual
Cuadro sinoptico marco conceptualCuadro sinoptico marco conceptual
Cuadro sinoptico marco conceptual
 
Perrilaku terpuji
Perrilaku terpujiPerrilaku terpuji
Perrilaku terpuji
 

Similar to Xml to xml transformation in mule

Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mulemdfkhan625
 
Mule xml transformation
Mule xml transformationMule xml transformation
Mule xml transformationD.Rajesh Kumar
 
Xml to xml transformation
Xml to xml transformationXml to xml transformation
Xml to xml transformationSon Nguyen
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in muleGermano Barba
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in muleDavide Rapacciuolo
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in muleDavide Rapacciuolo
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule javeed_mhd
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule mdfkhan625
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule Rajkattamuri
 
Using xslt in mule
Using  xslt in muleUsing  xslt in mule
Using xslt in muleKhan625
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in muleirfan1008
 
Xslt with mule
Xslt with muleXslt with mule
Xslt with muleSon Nguyen
 

Similar to Xml to xml transformation in mule (20)

Xml transform
Xml transformXml transform
Xml transform
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Mule xml transformation
Mule xml transformationMule xml transformation
Mule xml transformation
 
Xml to xml transformation
Xml to xml transformationXml to xml transformation
Xml to xml transformation
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
 
Using xslt in mule
Using  xslt in muleUsing  xslt in mule
Using xslt in mule
 
Using xslt in mule
Using xslt in mule Using xslt in mule
Using xslt in mule
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Xslt with mule
Xslt with muleXslt with mule
Xslt with mule
 
Using XSLT in Mule
Using XSLT in MuleUsing XSLT in Mule
Using XSLT in Mule
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
 
Xml toobjectesbtransform
Xml toobjectesbtransformXml toobjectesbtransform
Xml toobjectesbtransform
 

More from Mohammed625

Mule with drools
Mule with drools Mule with drools
Mule with drools Mohammed625
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json Mohammed625
 
Simple groovy example in mule
Simple groovy example in mule Simple groovy example in mule
Simple groovy example in mule Mohammed625
 
Webservice with vm in mule
Webservice with vm in mule Webservice with vm in mule
Webservice with vm in mule Mohammed625
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedureMohammed625
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standaloneMohammed625
 
Mule real world old
Mule real world oldMule real world old
Mule real world oldMohammed625
 
Mule esb introduction
Mule esb introductionMule esb introduction
Mule esb introductionMohammed625
 
Scatter gather in mule
Scatter gather in muleScatter gather in mule
Scatter gather in muleMohammed625
 
Java multithreading
Java multithreadingJava multithreading
Java multithreadingMohammed625
 
WebServices using Soap
WebServices using SoapWebServices using Soap
WebServices using SoapMohammed625
 

More from Mohammed625 (16)

Mule with drools
Mule with drools Mule with drools
Mule with drools
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json
 
Simple groovy example in mule
Simple groovy example in mule Simple groovy example in mule
Simple groovy example in mule
 
Webservice with vm in mule
Webservice with vm in mule Webservice with vm in mule
Webservice with vm in mule
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedure
 
Deploying and running in mule standalone
Deploying and running in mule standaloneDeploying and running in mule standalone
Deploying and running in mule standalone
 
Mule real world old
Mule real world oldMule real world old
Mule real world old
 
Mule esb introduction
Mule esb introductionMule esb introduction
Mule esb introduction
 
Mule overview
Mule overviewMule overview
Mule overview
 
Mule technology
Mule technologyMule technology
Mule technology
 
Presentation
PresentationPresentation
Presentation
 
Scatter gather in mule
Scatter gather in muleScatter gather in mule
Scatter gather in mule
 
Java multithreading
Java multithreadingJava multithreading
Java multithreading
 
WebServices using Soap
WebServices using SoapWebServices using Soap
WebServices using Soap
 
Sunstate
SunstateSunstate
Sunstate
 
MuleEsb
MuleEsbMuleEsb
MuleEsb
 

Recently uploaded

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Xml to xml transformation in mule

  • 1. XML to XML transformation in Mule
  • 2. As we know, there can be multiple types of payload we need to deal daily, starting from JSON, XML or String, we also require different type of data transformation in our application like XML to JSON, JSON to XML or String etc . In Mule application, we have a various set of transformers that we can use to obtain our required data format. Here we will be discussing on transformation of XML to XML format of data. If you have gone through my previous slides on JSON to JSON transformation here , you will realize how easy it is to perform such type of transformation in Mule. Here we will take the same example, but will be doing it on XML instead of JSON this time.
  • 3. So, let us consider, we have the following XML payload as an input to our application :- <RootTag> <name>Anirban Sen Chowdhary</name> <id>37</id> </RootTag> .
  • 4. We can see here the XML contains only 2 elements, that is name and id. So, now if this XML data is coming as an input and we require to transform/modify the payload into another XML format and produce it as an output, something like the following :- <RootTag> <name>Anirban Sen Chowdhary</name> <id>37</id> <designation>Director</designation> </RootTag>
  • 5. And here you can see the modified XML has a new element designation as a third element . Now, the challenge here is to modify the existing input XML payload and to design an output XML payload from it, which will contain this additional element in it with the same format. So, how can we transform/modify the payload into another XML format in an easy way. We know Mule has extremely powerful tools called Datamapper but that limited to Mule enterprise edition.
  • 6. How to transform or modify a XML payload in Mule ??
  • 7. A simple way of doing it is using XSLT in Mule. Mule do have XSLT support in it’s flow, which makes the life of a developer easy in transforming/modifying XML in the required format. So, here is the Mule flow which can be use to transform XML payload from one format to another using XSLT :-
  • 8. After that, we are setting the designation variable with a value, which will be passed into our XSLT, and it will be adding it there as a node called designation. So, the XML output coming after XSLT will be the modified/transformed XML containing additional node called designation. The XSL file here named as Transform.xsl should be kept under src/main/resources folder and the xsl file will be as following :-
  • 9. The graphical representation of this flow will be as follows :-
  • 11. Now, we are done with our coding and will deploy our application and test it. Once deployed on Mule server, we can test our application using RestClient or any other client you wish.
  • 12. once we click the send button we will get the following response in our client from our Mule flow :-
  • 14. So, you can find transforming or modifying a XML payload into another XML format is extremely easy in Mule using the XSLT . And that means you can design your output XML payload in any format you require using XSLT easily in your Mule flow and Mule also support this by it’s XSLT transformer !!! That’s all !!! I’ve hopefully been clear enough in displaying the implementation of XSLT and XSLT transformer in designing and modifying your XML payload which you can produce as an output from your Mule application. I hope you liked this !!!
  • 15. Hope you enjoyed the simple yet an amazing trick in Mule You can also find this post here :- http://bushorn.com/xml-to-xml- transformation-in-mule/