public static void removeChildren(IContainer that) {
boolean updateState;
if (that.getState() == IParentNode.INCOMPLETE && that.getBuilder() != null) {
OMNode lastKnownChild = that.getLastKnownOMChild();
if (lastKnownChild != null) {
lastKnownChild.build();
}
((StAXOMBuilder)that.getBuilder()).discard(that);
updateState = true;
} else {
updateState = false;