How to Print XML? Simple 2 Step Process

Jun 4, 2020

2 mins read

Published in
How to print XML?

How to print XML? what kind of blog is this? is there a use of printer nowadays? hmm…

So the right question would be where do you print the XML? on browser console? on PDF ? on Papar (really!!)? or just want to format the XML data.

Let’s start with printing xml on browser console.

Here is the code which uses vkbeautify javascript library which prints XML into the console.

<!DOCTYPE html>
    <script src=""></script>
      var parser, xmlDoc;
      var text =


Copy the HTML code and create .html file, open in browser and open console to see the beautiful XML will be in Browser console log.

Here is a way to create XML PDF. I don’t want to go into complex coding do to this. I have developed a tool which will help to do the same.

Follow this steps.

Go to XML Pretty Print tool.

how to print xml, open,

ho Copy and paste you XML in Input XML Text area or click on Sample link

Click on XML Print button, which will open a print view of XML. Now you have the option to Print or Save as PDF.

how to print XML which helps to print in PDF or on Paper.

Print view with XML data.

This article helps to Print beautiful XML on Brower Console, PDF and on Paper.

Advance topic XML from URL and File.

Now we are going for more advance into this topic what if you have URL or File which you want to beautify and print?

Here are the steps for the XML from URL.

XML from URL

Go to XML Pretty Print tool. Click on “Load Data” button, which will open a dialogue box to enter a URL string into Text.

Paste your XML URL into the textbox and hit Load URL. It will fetch the data from the URL and update the Input XML text area. Click on XML Print to Write XML to PDF or Paper.

Load XML data from URL

Upload data Popup

XML from File

Go to XML Pretty Print tool. Click on “Load Data” button, which will open a dialogue box.

Click Upload File button which will open a file selector. Select XML file and Hit Open.

XML file will be uploaded and loaded in the Input XML area.

Click XML Print to Print XML to PDF or Paper.


Sharing is caring!