static ComposableBody fromStaticBody(final StaticBody body)
    throws BOSHException {
        String raw = body.toXML();
        Matcher matcher = BOSH_START.matcher(raw);
        if (!matcher.find()) {
            throw(new BOSHException(
                    "Could not locate 'body' element in XML.  The raw XML did"
                    + " not match the pattern: " + BOSH_START));
        }
        String payload;
        if (">".equals(matcher.group(1))) {
            int first = matcher.end();
            int last = raw.lastIndexOf("</");
            if (last < first) {
                last = first;
            }
            payload = raw.substring(first, last);
        } else {
            payload = "";
        }

        return new ComposableBody(body.getAttributes(), payload);
    }