# XmlElement.Select Method

> Selects the text of the XML element. The text can only be selected, if the element belongs to the document.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > XmlElement.Select Method
- **340 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlelement/select-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlelement/select-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlelement/select-method/llms-full.txt

---

### Description

Selects the text of the XML element. The text can only be selected, if the element belongs to the document.

### Syntax

```csharp
public bool Select();
```

```vbnet
Public Function [Select]() As Boolean
```

### Return Value

The return value is true, if the text could be selected. Otherwise it is false.

### Examples

The following example selects the requested part of the xml element.

```csharp
if (xmlElement.Select())
{
    Console.WriteLine("Select completed successfully.");
}
```

```vbnet
If xmlElement.Select() Then
    Console.WriteLine("Select completed successfully.")
End If
```

### Remarks

If the element consists of several sub-elements Text Control selects the text of the first sub-element.

---

## Nearby

- **Previous:** [XmlElement.RemoveChild Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlelement/removechild-method/llms-full.txt)
- **Next:** [XmlElement.Text Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlelement/text-property/llms-full.txt)
