# Editing Documents

## Content

C1Editor supports editing complete <span data-highlighted="true" data-vc="highlighted-text">XHTML</span> documents and individual document fragments. This section describes operations for retrieving, replacing, removing, formatting, and inserting document content.

***

## Retrieve Text

Retrieve unformatted text from a document using the [GetText](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.GetText.html) method of the [C1Editor](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.html) class, as shown in the following code example.
Use the [GetText](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.GetText.html) method of the [C1Editor](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.html) class to retrieve the unformatted text contained in the document.

```auto
var text = c1Editor1.GetText();
MessageBox.Show(text);
```

***

## Replace an Element

Use the [ReplaceElement](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.ReplaceElement.html) method of the `C1Editor` class to replace the content of a specific document element.
The method accepts the replacement content and the ID of the HTML fragment to replace. For example, an element with the ID `head` can be replaced with updated heading content.

```auto
c1Editor1.ReplaceElement(" <h1 id=\"head\">About Nikola Tesla</h1>", "head");
```

***

## Delete Specific Element

Use the [RemoveElement](/componentone/api/win/online-editor-net/dotnet-api/C1.Win.Editor.10/C1.Win.Editor.C1Editor.RemoveElement.html) method of the `C1Editor` class to remove a document element.
The method can identify elements by ID, tag name, or class name.
The following example removes the element with **Id "P1"**.

```auto
c1Editor1.RemoveElement("P1");
```