<PackageReference Include="System.Xml.XmlDocument" Version="4.0.1-beta-23409" />

XmlElement

public class XmlElement : XmlLinkedNode
Represents an element.
public virtual bool HasAttributes { get; }

Gets a boolean value indicating whether the current node has any attributes.

public bool IsEmpty { get; set; }

Gets or sets the tag format of the element.

public virtual string GetAttribute(string name)

Returns the value for the attribute with the specified name.

public virtual string GetAttribute(string localName, string namespaceURI)

Returns the value for the attribute with the specified local name and namespace URI.

public virtual XmlAttribute GetAttributeNode(string name)

Returns the XmlAttribute with the specified name.

public virtual XmlAttribute GetAttributeNode(string localName, string namespaceURI)

Returns the XmlAttribute with the specified local name and namespace URI.

public virtual XmlNodeList GetElementsByTagName(string name)

Returns an XmlNodeList containing a list of all descendant elements that match the specified Name.

public virtual XmlNodeList GetElementsByTagName(string localName, string namespaceURI)

Returns an XmlNodeList containing a list of all descendant elements that match the specified LocalName and NamespaceURI.

public virtual bool HasAttribute(string name)

Determines whether the current node has an attribute with the specified name.

public virtual bool HasAttribute(string localName, string namespaceURI)

Determines whether the current node has an attribute with the specified local name and namespace URI.

public virtual void RemoveAllAttributes()

Removes all specified attributes from the element. Default attributes are not removed.

public virtual void RemoveAttribute(string name)

Removes an attribute by name.

public virtual void RemoveAttribute(string localName, string namespaceURI)

Removes an attribute with the specified local name and namespace URI. (If the removed attribute has a default value, it is immediately replaced).

public virtual XmlNode RemoveAttributeAt(int i)

Removes the attribute node with the specified index from the element. (If the removed attribute has a default value, it is immediately replaced).

Removes the specified XmlAttribute.

public virtual XmlAttribute RemoveAttributeNode(string localName, string namespaceURI)

Removes the XmlAttribute specified by the local name and namespace URI. (If the removed attribute has a default value, it is immediately replaced).

public virtual void SetAttribute(string name, string value)

Sets the value of the attribute with the specified name.

public virtual string SetAttribute(string localName, string namespaceURI, string value)

Sets the value of the attribute with the specified local name and namespace URI.

public virtual XmlAttribute SetAttributeNode(XmlAttribute newAttr)

Adds the specified XmlAttribute.

public virtual XmlAttribute SetAttributeNode(string localName, string namespaceURI)

Adds the specified XmlAttribute.