int count = 0;
SpecializedIdentifier<?>[] identifiers = new SpecializedIdentifier<?>[2];
if (uuid != null) identifiers[count++] = new SpecializedIdentifier<UUID> (IdentifierSpace.UUID, uuid);
if (xlink != null) identifiers[count++] = new SpecializedIdentifier<XLink>(IdentifierSpace.XLINK, xlink);
identifiers = ArraysExt.resize(identifiers, count);
metadata = resolver.newIdentifiedObject(context, type, identifiers);
}
} else {
// In principle, the XML should contain a full metadata object OR a uuidref attribute.
// However if both are present, assign the identifiers to that instance.
if (metadata instanceof IdentifiedObject) {