I want to remove the specific nodes from xml file under song tag whose id =2 from the following file in Android (Java):
<music> <song> <id>1</id> <albums_id>1</albums_id> <title>Someone Like You</title> <artist>Adele</artist> <duration>4:47</duration> </song> <song> <id>2</id> <albums_id>1</albums_id> <title>Space Bound</title> <artist>Eminem</artist> <duration>4:38</duration> </song> <song> <id>3</id> <albums_id>1</albums_id> <title>Stranger In Moscow</title> <artist>Michael Jackson</artist> <duration>5:44</duration> </song> </music>
after deletion / removing the nodes (suppose id = 2) expected output needed
<music> <song> <id>1</id> <albums_id>1</albums_id> <title>Someone Like You</title> <artist>Adele</artist> <duration>4:47</duration> </song> <song> <id>3</id> <albums_id>1</albums_id> <title>Stranger In Moscow</title> <artist>Michael Jackson</artist> <duration>5:44</duration> </song> </music>