// Change the phone numbers.
XmlCursor editCursor = resultCursor.newCursor();
editCursor.toLastAttribute();
editCursor.toNextToken();
editCursor.removeXml();
editCursor.insertChars("(206)555-1234");
} while (resultCursor.toNextSibling());
resultCursor.toStartDoc();
System.out.println("The query results after changes: \n");
System.out.println(resultCursor.getObject().toString() + "\n");