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;
}

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 ; }
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 .
