Buggy code:
public class Presence extends Packet { private Presence . Type type = Presence . Type . AVAILABLE ; private String status = null ; private int priority = - 1 ; private Presence . Mode mode = Presence . Mode . AVAILABLE ; public Presence ( Presence . Type type ) { } public Presence ( Presence . Type type , String status , int priority , Presence . Mode mode ) { } public Presence . Type getType ( ) { } public void setType ( Presence . Type type ) { } public String getStatus ( ) { } public void setStatus ( String status ) { } public int getPriority ( ) { } public void setPriority ( int priority ) { } public Presence . Mode getMode ( ) { } public void setMode ( Presence . Mode mode ) { } public String toXML ( ) { StringBuffer buf = new StringBuffer ( ) ; buf . append ( "<presence" ) ; if ( ( getPacketID ( ) ) != null ) { buf . append ( "<seq2seq4repair_space>id=\"" ) . append ( getPacketID ( ) ) . append ( "\"" ) ; } if ( ( getTo ( ) ) != null ) { buf . append ( "<seq2seq4repair_space>to=\"" ) . append ( StringUtils . escapeForXML ( getTo ( ) ) ) . append ( "\"" ) ; } if ( ( getFrom ( ) ) != null ) { buf . append ( "<seq2seq4repair_space>from=\"" ) . append ( StringUtils . escapeForXML ( getFrom ( ) ) ) . append ( "\"" ) ; } if ( ( type ) != ( Presence . Type . AVAILABLE ) ) { buf . append ( "<seq2seq4repair_space>type=\"" ) . append ( type ) . append ( "\"" ) ; } buf . append ( ">" ) ; if ( ( status ) != null ) { <START_BUG> buf . append ( "<status>" ) . append ( status ) . append ( "<//status>" ) ; <END_BUG> } if ( ( priority ) != ( - 1 ) ) { buf . append ( "<priority>" ) . append ( priority ) . append ( "<//priority>" ) ; } if ( ( ( mode ) != null ) && ( ( mode ) != ( Presence . Mode . AVAILABLE ) ) ) { buf . append ( "<show>" ) . append ( mode ) . append ( "<//show>" ) ; } buf . append ( this . getExtensionsXML ( ) ) ; XMPPError error = getError ( ) ; if ( error != null ) { buf . append ( error . toXML ( ) ) ; } buf . append ( "<//presence>" ) ; return buf . toString ( ) ; } public String toString ( ) { } public static class Type { public static final Presence . Type AVAILABLE = new Presence . Type ( "available" ) ; public static final Presence . Type UNAVAILABLE = new Presence . Type ( "unavailable" ) ; public static final Presence . Type SUBSCRIBE = new Presence . Type ( "subscribe" ) ; public static final Presence . Type SUBSCRIBED = new Presence . Type ( "subscribed" ) ; public static final Presence . Type UNSUBSCRIBE = new Presence . Type ( "unsubscribe" ) ; public static final Presence . Type UNSUBSCRIBED = new Presence . Type ( "unsubscribed" ) ; public static final Presence . Type ERROR = new Presence . Type ( "error" ) ; private String value ; private Type ( String value ) { } public String toString ( ) { } public static Presence . Type fromString ( String value ) { } } public static class Mode { public static final Presence . Mode AVAILABLE = new Presence . Mode ( "available" ) ; public static final Presence . Mode CHAT = new Presence . Mode ( "chat" ) ; public static final Presence . Mode AWAY = new Presence . Mode ( "away" ) ; public static final Presence . Mode EXTENDED_AWAY = new Presence . Mode ( "xa" ) ; public static final Presence . Mode DO_NOT_DISTURB = new Presence . Mode ( "dnd" ) ; public static final Presence . Mode INVISIBLE = new Presence . Mode ( "invisible" ) ; private String value ; private Mode ( String value ) { } public String toString ( ) { } public static Presence . Mode fromString ( String value ) { } } }

Fix:
buf . append ( "<status>" ) . append ( StringUtils . escapeForXML ( status ) ) . append ( "<//status>" ) ;