private void writeObject(final ObjectOutputStream out) throws IOException {
		// sends out the name and namespace.
		out.defaultWriteObject();
		if (hasAdditionalNamespaces()) {
			final int ans = additionalNamespaces.size();
			out.writeInt(ans);
			for (int i = 0; i < ans; i++) {
				out.writeObject(additionalNamespaces.get(i));
			}
		} else {
			out.writeInt(0);
		}
		if (hasAttributes()) {
			final int ans = attributes.size();
			out.writeInt(ans);
			for (int i = 0; i < ans; i++) {
				out.writeObject(attributes.get(i));
			}
		} else {
			out.writeInt(0);
		}
		
		final int cs = content.size();
		out.writeInt(cs);
		for (int i = 0; i < cs; i++) {
			out.writeObject(content.get(i));
		}

	}