Good solution available in below link if xml data available in file, https://github.com/databricks/spark-xml
Below code convert xml to DataSet by loading physical file..
Dataset<Row> df = sqlContext.read().format("com.databricks.spark.xml")
.option("rowTag", "book")
.load("file:///C:/books.xml");
But If xml data available in JavaRdd then how to convert into Dataset?