protected void writeEscapeAttributeEntities(String text) throws IOException {
        if ( text != null ) {
            String escapedText = escapeAttributeEntities( text );
            writer.write( escapedText );
        }
    }
This will take the pre-defined entities in XML 1.0 and
convert their character representation to the appropriate
entity reference, suitable for XML attributes.
@param text the entities to escale
@return the escaped entities
xmppserver/src/main/java/org/jivesoftware/util/XMLWriter.java