@Override
    public CharSequence toXML(XmlEnvironment xmlEnvironment) {
        XmlStringBuilder sb = new XmlStringBuilder(this, xmlEnvironment);
        return sb.attribute(ELEM_URI, uri)
                .optAttribute(ELEM_MEDIA_TYPE, mediaType)
                .optAttribute(ELEM_WIDTH, width)
                .optAttribute(ELEM_HEIGHT, height)
                .closeEmptyElement();
    }
@Test
    public void testFull() {
        ThumbnailElement full = new ThumbnailElement(
                "cid:sha1+ffd7c8d28e9c5e82afea41f97108c6b4@bob.xmpp.org",
                "image/png",
                128,
                96);

        assertXmlSimilar("<thumbnail xmlns='urn:xmpp:thumbs:1'\n" +
                "uri='cid:sha1+ffd7c8d28e9c5e82afea41f97108c6b4@bob.xmpp.org'\n" +
                "media-type='image/png'\n" +
                "width='128'\n" +
                "height='96'/>",
                full.toXML());
    }