### Saxon.Api

- BinaryResource
- CatalogCollection
- DirectoryCollection
- DocumentBuilder
- DomDestination
- DynamicContext
- DynamicError
- EmptyEnumerator<T>
- ErrorReporter
- ErrorReporterToStaticError
- ErrorReporterWrapper
- ExtensionFunction
- ExtensionFunctionCall
- ExtensionFunctionDefinition
- Feature<T>
- FeatureKeys
- HostLanguage
- ICollectionFinder
- IErrorReporter
- IInvalidityHandler
- IMessageListener
- IMessageListener2
- InvalidityHandlerWrapper
- IPredicate<in XdmItem>
- IQueryResolver
- IResource
- IResourceCollection
- IResourceFactory
- IResultDocumentHandler
- IXmlLocation
- JarCollection
- NamespaceConstant
- NullDestination
- Predicate<T>
- Predicates
- Processor
- QName
- RawDestination
- RecoveryPolicy
- Resource
- ResourceCollection
- SchemaManager
- SchemaResolver
- SchemaValidationMode
- SchemaValidator
- Serializer
- StandardCollectionFinder
- StandardLogger
- StaticContext
- StaticError
- Step<TInput, TResult>
- Steps
- TextWriterDestination
- TreeModel
- URIQueryParameters
- ValidationFailure
- WhitespacePolicy
- XdmAnyArrayType
- XdmAnyFunctionType
- XdmAnyItemType
- XdmAnyMapType
- XdmAnyNodeType
- XdmArray
- XdmAtomicType
- XdmAtomicValue
- XdmAxis
- XdmDestination
  - - TreeProtector
- XdmEmptySequence
- XdmExternalObjectValue
- XdmFunctionItem
- XdmItem
- XdmItemType
- XdmMap
- XdmNode
- XdmNodeKind
- XdmSequenceType
- XdmValue
- XmlDestination
- XmlProcessingError
- XmlResource
- XPathCompiler
- XPathExecutable
- XPathSelector
- XQueryCompiler
- XQueryEvaluator
- XQueryExecutable
- Xslt30Transformer
- XsltCompiler
- XsltExecutable
  - - ParameterDetails
- XsltPackage
- XsltTransformer

### Saxon.Api

# Class XdmItem

Direct Known Subclasses
  XdmAtomicValue, XdmExternalObjectValue, XdmFunctionItem, XdmNode

public abstract class XdmItem
extends XdmValue

The class `XdmItem` represents an item in a sequence, as defined by the XDM data model. An item may be an atomic value, a node, a function (including maps and arrays), or an external object.

An item is a member of a sequence, but it can also be considered as a sequence (of length one) in its own right. `XdmItem` is a subtype of `XdmValue` because every item in the XDM data model is also a value.

It cannot be assumed that every sequence of length one will always be represented by an `XdmItem`. It is quite possible for an `XdmValue` that is not an `XdmItem` to hold a singleton sequence. Use XdmValue.Simplify to ensure that a singleton is represented as an `XdmItem`.

### Method Summary
string | GetStringValue() Get the string value of the item.
bool | IsAtomic() Determine whether the item is an atomic value.
bool | IsNode() Determine whether the item is a node or some other type of item.
bool | Matches(XdmItemType typei) Determine whether this item matches a given item type.

## Method Detail

### GetStringValue

public string GetStringValue()

Get the string value of the item.

- For an atomic value, the result is the same as casting the value to a string.
- For a node, the method returns the string value of the node. This is not the same as the result of XdmNode.ToString, which returns the result of serializing the node.
- For a function, including a map or array, the result is an error.
- For an external object, the result is the same as the result of calling `ToString()` on the external object.

In all cases the result is the same as applying the XPath `string()` function.

Returns:

The result of converting the item to a string.

### IsAtomic

public abstract bool IsAtomic()

Determine whether the item is an atomic value.

Returns:

True if the item is an atomic value, false if it is a node, function, or external object.

### IsNode

public bool IsNode()

Determine whether the item is a node or some other type of item.

Returns:

True if the item is a node, false if it is an atomic value or a function (including maps and arrays).

### Matches

public bool Matches(XdmItemType typei)

Determine whether this item matches a given item type.

Parameters:

`typei` - The item type to be tested against this item

Returns:

True if the item matches this item type, false if it does not match.