# XmlElement Constructor

> Initializes a new instance of the XmlElement class.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Constructor
- **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 Constructor
- **578 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlelement/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlelement/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlelement/constructor/llms-full.txt

---

### Description

Initializes a new instance of the XmlElement class.

### Syntax

#### XmlElement(string)

Creates an XmlElement object with the specified name.

```csharp
public XmlElement(string name);
```

```vbnet
Public Sub New(name As String)
```

| Parameter | Description |
|---|---|
| name | Specifies the element's name. |

#### XmlElement(string, string)

Creates an XmlElement object with the specified name and text.

```csharp
public XmlElement(string name, string text);
```

```vbnet
Public Sub New(name As String, text As String)
```

| Parameter | Description |
|---|---|
| name | Specifies the element's name. |
| text | Specifies the element's text. |

### Examples

The following example creates a Xml Element instance and configures its text setting for a document workflow.

```csharp
XmlElement xmlElement = new("CustomerName");
xmlElement.Text = "Quarterly results";
```

```vbnet
Dim xmlElement As New XmlElement("CustomerName")
xmlElement.Text = "Quarterly results"
```

---

## Nearby

- **Previous:** [XmlElement.AutoText Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlelement/autotext-property/llms-full.txt)
- **Next:** [XmlElement.ElementName Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlelement/elementname-property/llms-full.txt)
