Io ho un file xml già creato. Come faccio per aggiungere un nodo al suo interno?

Io ho provato a fare così:
codice:
DocumentBuilderFactory docfactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = docfactory.newDocumentBuilder();

Document d = builder.parse(application.getRealPath("/") + "rubrica.xml");


radice = d.getDocumentElement();
Element persona = d.createElement("persona");
Element nome = d.createElement("nome");
nome.appendChild(d.createTextNode(n));
persona.appendChild(nome);
radice.appendChild(persona);
Ma devo poi salvare il file con PrintStream?
Potete darmi qualche indicazione? grazie