for (Map.Entry<String,String> entry : mAttrs.entrySet()) { Element a = identity.addElement(AccountService.E_A); a.addAttribute(AccountService.A_NAME, entry.getKey()); a.setText(entry.getValue());
for (Map.Entry<String,Object> entry : mAttrs.entrySet()) { if (entry.getValue() instanceof String[]) { String[] values = (String[]) entry.getValue(); for (String value : values) { Element a = identity.addElement(AccountService.E_A); a.addAttribute(AccountService.A_NAME, entry.getKey()); a.setText(value); } } else { Element a = identity.addElement(AccountService.E_A); a.addAttribute(AccountService.A_NAME, entry.getKey()); a.setText(entry.getValue().toString()); }
    public Element toElement(Element parent) {        Element identity = parent.addElement(AccountService.E_IDENTITY);        identity.addAttribute(AccountService.A_NAME, mName);        for (Map.Entry<String,String> entry : mAttrs.entrySet()) {            Element a = identity.addElement(AccountService.E_A);            a.addAttribute(AccountService.A_NAME, entry.getKey());            a.setText(entry.getValue());        }        return identity;    }