Neither of those will work, you would be much safer to use a fixed element name and put the key as an attribute:
<entry key="ipaddress>">192.168.1.25</entry>
I would strongly recommend you use a proper XML aware API to write XML files, which will handle any necessary escaping for you automatically.