_pp.print ("<" + anElement.getName ());
XMLNodeIterator nodeIt = anElement.children ();
int attrCount = 0;
while (nodeIt.hasNext ()) {
XMLNode child = nodeIt.next ();
if (child instanceof XMLAttribute) {
child.accept (this);
attrCount++;
}
}
if (attrCount == anElement.childCount ()) {
_pp.printSimple (" />\n");
} else {
_pp.printSimple (">\n");
_pp.inc ();
nodeIt = anElement.children ();
while (nodeIt.hasNext ()) {
XMLNode child = nodeIt.next ();
if (!(child instanceof XMLAttribute)) {
child.accept (this);
}
}
_pp.pop ();
_pp.println ("</" + anElement.getName () + ">");
}