private void writeState(XmlSerializer serializer, Node<?> node) throws IOException { Entity parent = node.getParent(); if (parent != null) { State s = parent.getChildState(node.getName()); int state = s.intValue(); if (state > 0) { serializer.attribute(null, STATE_ATTRIBUTE, Integer.toString(state)); } } }