1
Element.toXML()
的默认行为似乎以单行显示结果。是否有可能以多层次的方式显示多行结果?让Element.toXML()正确缩进而不是将结果字符串显示为单行?
例子:
这是我想获得
<root>
<Fraction hash="108e898f" />
<Integer hash="19498483" />
</root>
什么,这就是我目前得到:
<root><Fraction hash="108e898f" /><Integer hash="19498483" /></root>
感谢