I would post this in Feature Requests... I'm surprised it's not already implemented!
Here's a procedure based on infratec's suggestion... silly, but it should work
Code:
Procedure FormatXMLWithTabs(XML.i)
FormatXML(XML, #PB_XML_ReFormat)
Text.s = ComposeXML(XML)
nSpaces.i = 4
IndentStr.s = Space(nSpaces)
While (FindString(Text, IndentStr))
nSpaces * 2
IndentStr = Space(nSpaces)
Wend
FormatXML(XML, #PB_XML_ReFormat, nSpaces)
ParseXML(XML, ReplaceString(ComposeXML(XML), IndentStr, #TAB$))
EndProcedure
CreateXML(0)
*Main = CreateXMLNode(RootXMLNode(0), "main")
*Child = CreateXMLNode(*Main, "child")
For i = 1 To 3
CreateXMLNode(*Child, "sub")
Next i
*Child = CreateXMLNode(*Main, "child")
For i = 1 To 3
CreateXMLNode(*Child, "sub")
Next i
FormatXMLWithTabs(0)
SetCurrentDirectory(GetTemporaryDirectory())
SaveXML(0, "temp.xml")
RunProgram("temp.xml")