Properly formatted XML and list returning code