The output of this code
import kxml.xml;
import std.stdio: writeln;
XmlNode nodeAttributes = new XmlNode("attributes");
nodeAttributes.addChild(new XmlNode("divisions").setCData("1"));
nodeAttributes.addChild(new XmlNode("key").addChild(
new XmlNode("fifths").setCData("0")));
nodeAttributes.addChild(new XmlNode("time").addChildren([
new XmlNode("beats").setCData("4"),
new XmlNode("beats-type").setCData("4") ]));
writeln(nodeAttributes.toPrettyString());
is
<attributes>
<divisions>
1
</divisions>
<key>
<fifths>
0
</fifths>
</key>
<time>
<beats>
4
</beats>
<beats-type>
4
</beats-type>
</time>
</attributes>
The unecessary line breaks for the tag contents causes issues for other xml parsers.
The output of this code
is
The unecessary line breaks for the tag contents causes issues for other xml parsers.