@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 testMinimal() {
        ThumbnailElement minimal = new ThumbnailElement("cid:sha1+ffd7c8d28e9c5e82afea41f97108c6b4@bob.xmpp.org");

        assertXmlSimilar("<thumbnail xmlns='urn:xmpp:thumbs:1'\n" +
                "uri='cid:sha1+ffd7c8d28e9c5e82afea41f97108c6b4@bob.xmpp.org'/>",
                minimal.toXML());
    }