I'm trying to add this XML element:

<cp:prop name="given_name" value="UK" />

It has to be formatted exactly as above.

I've tried this but it formats differently:

Dim cp = XNamespace.Get("cp")
Dim newElement As New XElement(cp + "prop", New XAttribute("name", "given_name"), New XAttribute("value", givenName)))

It formats like this:

<prop name="given_name" value="UK" xmlns="cp" />

Please help!! :)

Do this instead:

Dim newElement As New XElement("cp:prop", New XAttribute("name", "given_name"), New XAttribute("value", givenName)))

Tried that, you get this error:

'The ':' character, hexadecimal value 0x3A, cannot be included in a name.'

This damn XML stuff is going to kill me :)