Change your xml string as:
String xml = "<?xml version='1.0' encoding='UTF-8'?>" +
"<item_list>" +
"<category id='2' name='categoryName'>" +
"<item id='41' name='item1' />" +
"</category>" +
"</item_list>";
Currently you are missing xml document header <?xml version='1.0' encoding='UTF-8'?>
in your string
for more help how we create xml doc in android see this tutorial :
http://xjaphx.wordpress.com/2011/10/27/android-xml-adventure-create-write-xml-data/