Dim doc As New XmlDocument() doc.Load(filename) Dim mediaNodes As XmlNodeList = doc.Select("//media") 'find media element anywhere in the document using an XPath query For Each node As XmlNode In mediaNodes node.ParentNode.RemoveChild(node) 'remove this node from the it's parent Next