# Module: ol/xml

This documentation is for OpenLayers v10.9.0. The latest is v.

## ol/xml

    import * as olXml from 'ol/xml';

### Functions

#### getAllTextContent(node, normalizeWhitespace){string}

xml.js, line 45

      import {getAllTextContent} from 'ol/xml';

  Recursively grab all text content of child nodes into a single string.

  Name | Type | Description
  --- | --- | ---
  `node` | Node | Node.
  `normalizeWhitespace` | boolean | Normalize whitespace: remove all line breaks.

  ##### Returns:

  All text content.

#### parse(xml){Document}

xml.js, line 101

      import {parse} from 'ol/xml';

  Parse an XML string to an XML Document.

  Name | Type | Description
  --- | --- | ---
  `xml` | string | XML.

  ##### Returns:

  Document.

#### registerDocument(document)

xml.js, line 547

      import {registerDocument} from 'ol/xml';

  Register a Document to use when creating nodes for XML serializations. Can be used to inject a Document where there is no globally available implementation.

  Name | Type | Description
  --- | --- | ---
  `document` | Document | A Document.

#### registerXMLSerializer(xmlSerializer)

xml.js, line 524

      import {registerXMLSerializer} from 'ol/xml';

  Register a XMLSerializer. Can be used to inject a XMLSerializer where there is no globally available implementation.

  Name | Type | Description
  --- | --- | ---
  `xmlSerializer` | XMLSerializer | A XMLSerializer.

### Type Definitions

#### NodeStackItem{Object}

  When using `makeChildAppender` or `makeSimpleNodeFactory`, the top `objectStack` item needs to have this structure.

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `node` | Element | Node.

#### Parser()

xml.js, line 14

#### Serializer()

xml.js, line 18