public DateTime newInstance( final Class<DateTime> cls, final javolution.xml.XMLFormat.InputElement input )
throws XMLStreamException {
final long millis = input.getAttribute( MILLIS ).toLong();
final Chronology chronology = readChronology( input );
final DateTimeZone tz = readTimeZone( input );
return new DateTime( millis, chronology.withZone( tz ) );
}
private Chronology readChronology( final javolution.xml.XMLFormat.InputElement input ) throws XMLStreamException {
final CharArray chronologyId = input.getAttribute( CHRONOLOGY );
return IdentifiableChronology.valueOfId( chronologyId != null ? chronologyId.toString() : null );