Good Afternoon,

I'm creating an element with an attribute in an existing xml file name "Employees" and what it's doing in the file is this;

<Employees recordCount="1" />

What I want it to do is to wrap around the rest of the file like so;

<?xml version="1.0" standalone="yes"?>
<EmployeeLoad xmlns="">
<Employees recordCount="1" >
<SupervisorEmployeeID />

The code I'm using to do this is as follows:

'Insert Employees element to the xml file before Employee element
Dim root As XmlElement = XDoc.DocumentElement
Dim xmlEmployeeLoad As XmlElement = XDoc.CreateElement("Employees")
root.InsertBefore(xmlEmployeeLoad, root.FirstChild)

'Add record count to the Employees element
Dim dataNodes As XmlNodeList = XDoc.GetElementsByTagName("Employees")
If (Not dataNodes Is Nothing And dataNodes.Count > 0) Then
Dim a As XmlAttribute = XDoc.CreateAttribute("recordCount")
a.Value = intCount.ToString()
End If

''Save to changes to the xml file

Any ideas would be greatly appreciated!