if(TypeUtil.subtypeOf(t, Untyped.UNTYPED) || TypeUtil.subtypeOf(t, mixed)) {
// - If the element is of type xdt:untyped,
// its typed-value is its dm:string-value as an xdt:untypedAtomic.
// - If the element has a complex type with mixed content (including xs:anyType),
// its typed-value is its dm:string-value as an xdt:untypedAtomic.
return new UntypedAtomicValue(stringValue());
} else if(t instanceof ComplexType) {
ContentType ct = ((ComplexType) t).getContentType();
if(ct.isType(ContentType.EmptyContent)) {
// - If the element has a complex type with empty content, its typed-value
// is the empty sequence.
return ValueSequence.<AtomicValue> emptySequence();
} else if(ct.isType(ContentType.SimpleContent)) {
// - If the element has a simple type or a complex type with simple content,
// the result is a sequence of zero or more atomic values.
return new UntypedAtomicValue(stringValue().toString());
}
}
// The typed-value of such an element is undefined.
// Attempting to access this property with the dm:typed-value accessor always raises
// an error.