private void writeObject(ObjectOutputStream out) throws IOException {
    // sends out the name and namespace.
    out.defaultWriteObject();
    if (hasAdditionalNamespaces()) {
      final int ans = additionalNamespaces.size();
      out.writeInt(ans);
      for (Namespace additionalNamespace : additionalNamespaces) {
        out.writeObject(additionalNamespace);
      }
    }
    else {
      out.writeInt(0);
    }
    if (hasAttributes()) {
      final int ans = attributes.size();
      out.writeInt(ans);
      for (Attribute attribute : attributes) {
        out.writeObject(attribute);
      }
    }
    else {
      out.writeInt(0);
    }

    int cs = content.size();
    out.writeInt(cs);
    for (Content value : content) {
      out.writeObject(value);
    }
  }
private void writeObject(ObjectOutputStream out)