code: public void marshal(Object obj, HierarchicalStreamWriter writer,
  			MarshallingContext context) {
  		XAttribute attribute = (XAttribute) obj;
  		writer.addAttribute("key", attribute.getKey());
  		writer.addAttribute("type", XAttributeUtils.getTypeString(attribute));
  		String value = attribute.toString();
  		if (value == null) {
  			throw new AssertionError("Attribute value must not be null");
  		}
  		writer.addAttribute("value", value);
  		if (attribute.getExtension() != null) {
  			writer.addAttribute("extension", attribute.getExtension().getUri()
  					.toString());
  		}
  		// marshal meta-attributes
  		if (attribute.getAttributes().size() > 0) {
  			writer.startNode("XAttributeMap");
  			XAttribute oldParent = (XAttribute) context.get(PARENT);
  			context.put(PARENT, attribute); 
  			context.convertAnother(attribute.getAttributes(),
  					XesXStreamPersistency.attributeMapConverter);
  			context.put(PARENT, oldParent);
  			writer.endNode();
  		}
  	}
docs: /*
  (non-Javadoc)
  
  @see
  com.thoughtworks.xstream.converters.Converter#marshal(java.lang.Object,
  com.thoughtworks.xstream.io.HierarchicalStreamWriter,
  com.thoughtworks.xstream.converters.MarshallingContext)