The error message is quite understandable. Please, refer xml documentation:
Extensible Markup Language (XML) 1.1 - documents[
^]:
Quote:
[Definition: There is exactly one element, called the root, or document element, no part of which appears in the content of any other element.] For all other elements, if the start-tag is in the content of another element, the end-tag is in the content of the same element. More simply stated, the elements, delimited by start- and end-tags, nest properly within each other.
So, you need to add root element to your xml:
<somenameofrootelement>
<seleniumobjectrepository></seleniumobjectrepository>
<seleniumrepobjects></seleniumrepobjects>
</somenameofrootelement>
[EDIT]
I'd suggest you to change your logic...
I do not recommend you to create global objects (even if it's used only within form class). Rather than it, open, edit and save xml document within button click event.
See:
XmlReader Class[
^]
How to: Parse XML with XmlReader[
^]
XmlWriter Class[
^]
Combining the XmlReader and XmlWriter classes for simple streaming transformations[
^]
Final note:
The simplest way to operate on xml data is to use
xml serialization and deserialization[
^].