@SuppressWarnings("unchecked")
private static Attribute getAttribute(String attributeName,
GregorianCalendar attributeValue) {
Attribute attribute = buildXMLObject(Attribute.class,
Attribute.DEFAULT_ELEMENT_NAME);
attribute.setName(attributeName);
XMLObjectBuilder<XSDateTime> builder = Configuration
.getBuilderFactory().getBuilder(XSDateTime.TYPE_NAME);
XSDateTime xmlAttributeValue = builder.buildObject(
AttributeValue.DEFAULT_ELEMENT_NAME, XSDateTime.TYPE_NAME);
int day = attributeValue.get(Calendar.DAY_OF_MONTH);
int month = attributeValue.get(Calendar.MONTH);
int year = attributeValue.get(Calendar.YEAR);
LOG.debug("day: " + day + " month: " + month + " year: " + year);
DateTime zulu = new DateTime(year, month + 1, day, 0, 0, 0, 0,
ISOChronology.getInstanceUTC());
xmlAttributeValue.setValue(zulu);
attribute.getAttributeValues().add(xmlAttributeValue);
LOG.debug("XmlAttributeValue: " + xmlAttributeValue.getValue());
return attribute;
}