You can research java saxparser, and java domparser. They will open up the xml document and allow you to walk through the document and do things to it. I believe this is rather an advanced topic for you to handle.
An alternative is to read the entire document (assuming its not too large) into an arrayList where each line in the file is a row in the arraylist.
Then work down the arraylist to locate the record you want to delete and remove it.
Locate a line that has <record> in it.
Locate the next line that has </record> in it.
Delete the above two lines and anything between them.
Note the above is not foolproof. The <record> and </record> tags may appear on the same line.
Afer your done altering the array, write it back to the file (overwrite the previous file contents).