class UserMessageArchivePreferencesElement {

    static UserMessageArchivePreferences fromXml(XMLElement prefsElement) throws XMLSemanticError {
        DefaultUserArchiveBehaviour defaultbehaviour = DefaultUserArchiveBehaviour
                .valueOf(prefsElement.getAttributeValue("default").toUpperCase());

        Set<Entity> alwaysJids = parseJids(prefsElement, "always");
        Set<Entity> neverJids = parseJids(prefsElement, "never");

        return new SimpleUserMessageArchivePreferences(defaultbehaviour, alwaysJids, neverJids);
    }

    private  UserMessageArchivePreferencesElement();

}