xml_print takes a string as its only argument, assumes that it contains XML code and indents it for better readability. The indented code is returned as string. The default indent is two spaces.
For example, input:
Output:
<?xml version='1.0'?> <root> <child1>some content</child1> <child2></child2> <child3/> </root>
Input:
Output:
<math mode='display' xmlns='http://www.w3.org/1998/Math/MathML'> <mfrac> <mn>1</mn> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <mn>1</mn> </mrow> </mfrac> </math>