XAttribute.Name Property gets the expanded name of this attribute.
Imports System Imports System.Xml Imports System.Xml.XPath Public Class MainClass Public Shared Sub Main() Dim root As XElement = _ <aw:Root xmlns:aw='http://www.domain.com' aw:Att='content' Att2='different content'/> For Each att As XAttribute In root.Attributes() Console.WriteLine("{0}={1}", att.Name, att.Value) Next Dim NewRoot As XElement = _ <Root <%= _ From att In root.Attributes("Att2") _ Select New XAttribute(att.Name, "new content") _ %>>_ </Root> For Each att As XAttribute In NewRoot.Attributes() Console.WriteLine("{0}={1}", att.Name, att.Value) Next End Sub End Class