Content

A representation of a generic XML node.

### Implementing classes

| Name | Brief description |
|---|---|
| `https://developers.google.com/apps-script/reference/xml-service/cdata` | A representation of an XML `CDATASection` node. |
| `https://developers.google.com/apps-script/reference/xml-service/comment` | A representation of an XML `Comment` node. |
| `https://developers.google.com/apps-script/reference/xml-service/doc-type` | A representation of an XML `DocumentType` node. |
| `https://developers.google.com/apps-script/reference/xml-service/element` | A representation of an XML `Element` node. |
| `https://developers.google.com/apps-script/reference/xml-service/entity-ref` | A representation of an XML `EntityReference` node. |
| `https://developers.google.com/apps-script/reference/xml-service/processing-instruction` | A representation of an XML `ProcessingInstruction` node. |
| `https://developers.google.com/apps-script/reference/xml-service/text` | A representation of an XML `Text` node. |

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/xml-service/content#asCdata()` | `https://developers.google.com/apps-script/reference/xml-service/cdata|null` | Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/cdata` node for the purposes of autocomplete. |
| `https://developers.google.com/apps-script/reference/xml-service/content#asComment()` | `https://developers.google.com/apps-script/reference/xml-service/comment|null` | Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/comment` node for the purposes of autocomplete. |
| `https://developers.google.com/apps-script/reference/xml-service/content#asDocType()` | `https://developers.google.com/apps-script/reference/xml-service/doc-type|null` | Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/doc-type` node for the purposes of autocomplete. |
| `https://developers.google.com/apps-script/reference/xml-service/content#asElement()` | `https://developers.google.com/apps-script/reference/xml-service/element|null` | Casts the node as an `https://developers.google.com/apps-script/reference/xml-service/element` node for the purposes of autocomplete. |
| `https://developers.google.com/apps-script/reference/xml-service/content#asEntityRef()` | `https://developers.google.com/apps-script/reference/xml-service/entity-ref|null` | Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/entity-ref` node for the purposes of autocomplete. |
| `https://developers.google.com/apps-script/reference/xml-service/content#asProcessingInstruction()` | `https://developers.google.com/apps-script/reference/xml-service/processing-instruction|null` | Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/processing-instruction` node for the purposes of autocomplete. |
| `https://developers.google.com/apps-script/reference/xml-service/content#asText()` | `https://developers.google.com/apps-script/reference/xml-service/text|null` | Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/text` node for the purposes of autocomplete. |
| `https://developers.google.com/apps-script/reference/xml-service/content#detach()` | `https://developers.google.com/apps-script/reference/xml-service/content#|null` | Detaches the node from its parent `https://developers.google.com/apps-script/reference/xml-service/element` node. |
| `https://developers.google.com/apps-script/reference/xml-service/content#getParentElement()` | `https://developers.google.com/apps-script/reference/xml-service/element|null` | Gets the node's parent `https://developers.google.com/apps-script/reference/xml-service/element` node. |
| `https://developers.google.com/apps-script/reference/xml-service/content#getType()` | `https://developers.google.com/apps-script/reference/xml-service/content-types` | Gets the node's content type. |
| `https://developers.google.com/apps-script/reference/xml-service/content#getValue()` | `String` | Gets the text value of all nodes that are direct or indirect children of the node, in the order they appear in the document. |

## Detailed documentation

### `asCdata()`

Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/cdata` node for the purposes of autocomplete. If the
node's `https://developers.google.com/apps-script/reference/xml-service/content-types` is not already `CDATA`, this method returns `null`.

#### Return


`https://developers.google.com/apps-script/reference/xml-service/cdata|null` --- The `CDATASection` node.

*** ** * ** ***

### `asComment()`

Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/comment` node for the purposes of autocomplete. If the node's
`https://developers.google.com/apps-script/reference/xml-service/content-types` is not already `COMMENT`, this method returns `null`.

#### Return


`https://developers.google.com/apps-script/reference/xml-service/comment|null` --- The `Comment` node, or `null` if the node's content type is not `https://developers.google.com/apps-script/reference/xml-service/content-types`.

*** ** * ** ***

### `asDocType()`

Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/doc-type` node for the purposes of autocomplete. If
the node's `https://developers.google.com/apps-script/reference/xml-service/content-types` is not already `DOCTYPE`, this method returns `null`.

#### Return


`https://developers.google.com/apps-script/reference/xml-service/doc-type|null` --- The `DocumentType` node.

*** ** * ** ***

### `asElement()`

Casts the node as an `https://developers.google.com/apps-script/reference/xml-service/element` node for the purposes of autocomplete. If the node's
`https://developers.google.com/apps-script/reference/xml-service/content-types` is not already `ELEMENT`, this method returns `null`.

#### Return


`https://developers.google.com/apps-script/reference/xml-service/element|null` --- The `Element` node.

*** ** * ** ***

### `asEntityRef()`

Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/entity-ref` node for the purposes of autocomplete.
If the node's `https://developers.google.com/apps-script/reference/xml-service/content-types` is not already `ENTITYREF`, this method returns
`null`.

#### Return


`https://developers.google.com/apps-script/reference/xml-service/entity-ref|null` --- The `EntityReference` node.

*** ** * ** ***

### `asProcessingInstruction()`

Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/processing-instruction` node for the purposes of autocomplete. If
the node's `https://developers.google.com/apps-script/reference/xml-service/content-types` is not already `PROCESSINGINSTRUCTION`, this method
returns `null`.

#### Return


`https://developers.google.com/apps-script/reference/xml-service/processing-instruction|null` --- The `ProcessingInstruction` node.

*** ** * ** ***

### `asText()`

Casts the node as a `https://developers.google.com/apps-script/reference/xml-service/text` node for the purposes of autocomplete. If the node's `https://developers.google.com/apps-script/reference/xml-service/content-types` is not already `TEXT`, this method returns `null`.

#### Return


`https://developers.google.com/apps-script/reference/xml-service/text|null` --- The `Text` node.

*** ** * ** ***

### `detach()`

Detaches the node from its parent `https://developers.google.com/apps-script/reference/xml-service/element` node. If the node does not have a parent,
this method has no effect.

#### Return


`https://developers.google.com/apps-script/reference/xml-service/content#|null` --- The detached node.

*** ** * ** ***

### `getParentElement()`

Gets the node's parent `https://developers.google.com/apps-script/reference/xml-service/element` node. If the node does not have a parent, this method
returns `null`.

#### Return


`https://developers.google.com/apps-script/reference/xml-service/element|null` --- The parent `Element` node.

*** ** * ** ***

### `getType()`

Gets the node's content type.

#### Return


`https://developers.google.com/apps-script/reference/xml-service/content-types` --- The node's content type.

*** ** * ** ***

### `getValue()`

Gets the text value of all nodes that are direct or indirect children of the node, in the order
they appear in the document.

#### Return


`String` --- The text value of all nodes that are direct or indirect children of the node.