code: public LoggingEvent decode(final String data) {
      Document document = parse(data);
  
      if (document == null) {
        return null;
      }
  
      Vector events = decodeEvents(document);
  
      if (events.size() > 0) {
        return (LoggingEvent) events.firstElement();
      }
  
      return null;
    }
docs: Converts the string data into an XML Document, and then soaks out the
  relevant bits to form a new LoggingEvent instance which can be used
  by any Log4j element locally.
  @param data XML fragment
  @return a single LoggingEvent or null