IDOMNode nextChild = (IDOMNode) node.getFirstChild();
while (nextChild != null) {
IDOMNode eachChildNode = nextChild;
nextChild = (IDOMNode) eachChildNode.getNextSibling();
IStructuredFormatter formatter = getFormatter(eachChildNode);
IStructuredFormatContraints childFormatContraints = formatter.getFormatContraints();
String childIndent = lineIndent + singleIndent;
childFormatContraints.setCurrentIndent(childIndent);
childFormatContraints.setClearAllBlankLines(formatContraints.getClearAllBlankLines());
childFormatContraints.setInPreserveSpaceElement(formatContraints.getInPreserveSpaceElement());
// format each child
formatter.format(eachChildNode, childFormatContraints);
if (nextChild != null && nextChild.getParentNode() == null)