this.setDoc(new Document());
this.setRoot(new Element(VCARD_FIELDS_ELEMENT));
Element fieldElement = null;
if(vcards != null){
for (int i = 0; i < vcards.size(); i++) {
VCardContactField vcard = vcards.get(i);
fieldElement = new Element(VCARD_FIELD_ELEMENT);
this.getRoot().addContent(fieldElement);
this.setCode(vcard.getCode(), fieldElement);
this.setDescription(vcard.getDescription(), fieldElement);
this.setEnabled(vcard.isEnabled(), fieldElement);
this.setProfileAttribute(vcard.getProfileAttribute(), fieldElement);
}
}
this.getDoc().setRootElement(this.getRoot());
}