XML is all on one line

I’m sure there’s a solution for this but I’m not sure what keywords to look for.

I have successfully exported some database info into an
XML file with the appendchild method.

However, the resulting file is xml tags in one long line - no tree structure - although it is technically correct when viewed through a browser.

How do I make the XML file generate the normal indentation when it is being populated with code like



..

Set nodeTemp = objXMLDoc.createElement("image")
		nodeTemp.nodeTypedValue = objADORS.Fields("image").Value
		nodepack.appendChild nodeTemp

...

objXMLDoc.Save strFilePath

...

I found an answer. It can be transformed with this stylesheet


<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output omit-xml-declaration="no" indent="yes"/>
    <xsl:template match="node()|@*">
      <xsl:copy>
        <xsl:apply-templates select="node()|@*"/>
      </xsl:copy>
    </xsl:template>
</xsl:stylesheet>