diff --git a/tempest/services/compute/xml/servers_client.py b/tempest/services/compute/xml/servers_client.py
index efb28e6..903e10c 100644
--- a/tempest/services/compute/xml/servers_client.py
+++ b/tempest/services/compute/xml/servers_client.py
@@ -182,13 +182,13 @@
         server = Element("server")
         doc.append(server)
 
-        if name:
+        if name is not None:
             server.add_attr("name", name)
-        if accessIPv4:
+        if accessIPv4 is not None:
             server.add_attr("accessIPv4", accessIPv4)
-        if accessIPv6:
+        if accessIPv6 is not None:
             server.add_attr("accessIPv6", accessIPv6)
-        if meta:
+        if meta is not None:
             metadata = Element("metadata")
             server.append(metadata)
             for k, v in meta:
@@ -228,10 +228,26 @@
                          flavorRef=flavor_ref,
                          name=name)
 
-        for attr in ["adminPass", "accessIPv4", "accessIPv6", "key_name"]:
+        for attr in ["adminPass", "accessIPv4", "accessIPv6", "key_name",
+                     "user_data", "availability_zone"]:
             if attr in kwargs:
                 server.add_attr(attr, kwargs[attr])
 
+        if 'security_groups' in kwargs:
+            secgroups = Element("security_groups")
+            server.append(secgroups)
+            for secgroup in kwargs['security_groups']:
+                s = Element("security_group", name=secgroup['name'])
+                secgroups.append(s)
+
+        if 'networks' in kwargs:
+            networks = Element("networks")
+            server.append(networks)
+            for network in kwargs['networks']:
+                s = Element("network", uuid=network['uuid'],
+                            fixed_ip=network['fixed_ip'])
+                networks.append(s)
+
         if 'meta' in kwargs:
             metadata = Element("metadata")
             server.append(metadata)
diff --git a/tempest/tests/compute/servers/test_servers_negative.py b/tempest/tests/compute/servers/test_servers_negative.py
index 366b630..9013b36 100644
--- a/tempest/tests/compute/servers/test_servers_negative.py
+++ b/tempest/tests/compute/servers/test_servers_negative.py
@@ -29,7 +29,6 @@
 
     @classmethod
     def setUpClass(cls):
-        raise cls.skipException("Until Bug 1046870 is fixed")
         super(ServersNegativeTest, cls).setUpClass()
         cls.client = cls.servers_client
         cls.img_client = cls.images_client
@@ -115,6 +114,8 @@
     @attr(type='negative')
     def test_create_numeric_server_name(self):
         # Create a server with a numeric name
+        if self.__class__._interface == "xml":
+            raise self.skipException("Not testable in XML")
 
         server_name = 12345
         self.assertRaises(exceptions.BadRequest,
@@ -182,7 +183,7 @@
     def test_update_server_of_another_tenant(self):
         # Update name of a server that belongs to another tenant
 
-        server = self.create_server()
+        resp, server = self.create_server(wait_until='ACTIVE')
         new_name = server['id'] + '_new'
         self.assertRaises(exceptions.NotFound,
                           self.alt_client.update_server, server['id'],
@@ -192,7 +193,7 @@
     def test_update_server_name_length_exceeds_256(self):
         # Update name of server exceed the name length limit
 
-        server = self.create_server()
+        resp, server = self.create_server(wait_until='ACTIVE')
         new_name = 'a' * 256
         self.assertRaises(exceptions.BadRequest,
                           self.client.update_server,
@@ -210,7 +211,7 @@
     def test_delete_a_server_of_another_tenant(self):
         # Delete a server that belongs to another tenant
         try:
-            server = self.create_server()
+            resp, server = self.create_server(wait_until='ACTIVE')
             self.assertRaises(exceptions.NotFound,
                               self.alt_client.delete_server,
                               server['id'])
@@ -245,3 +246,7 @@
 
         self.assertRaises(exceptions.NotFound, self.client.get_server,
                           '999erra43')
+
+
+class ServersNegativeTestXML(ServersNegativeTest):
+    _interface = 'xml'
