Hello Genius please Help....

Listview to XML file create

i want to create XML file from a Listview Control

if listview control has one item then, output xml file was working fine
but listview control has more than one items then output xml file has error
not opening in iexplorer or any other browser
but opened with notepad with no xml format
contains as normal string....

thats my code

PHP Code:
  Dim _xelement As XElement = <ErrorDetect>
                                        <%= 
From _itms As ListViewItem In _errorVirtualListview.Items
                                            Let fields 
_itms
                                            Select _
                                            
<Errors>
                                                <
Time><%= Now.ToString %></Time>
                                                <NameSpace>=<%= 
fields.Text %></NameSpace>
                                                <
MethodName>=<%= fields.SubItems(1).Text %></MethodName>
                                                <
Code>=<%= fields.SubItems(2).Text %></Code>
                                                <
Description><%= fields.SubItems(3).Text %></Description>
                                                <
number><%= fields.SubItems(4).Text %></number>
                                                <
Ex><%= fields.SubItems(5).Text %></Ex>
                                                <
CustomMessages><%= fields.SubItems(6).Text %></CustomMessages>
                                            </
Errors>
                                        %>
                                    </
ErrorDetect>

        
Trace.WriteLine(_xelement)
        
Using _xmlWritter As New XmlTextWriter("D:\xmlerrorfile.xml"Nothing)
            
_xmlWritter.WriteString(_xelement)
            
_xmlWritter.Flush()
            
_xmlWritter.Close()
        
End Using 
Thanks