Here is my code that works for manipulating other portions of document.xml for a docx file, but I am having trouble changing a setting that is part of the settings.xml part. I am basically performing a string replacement that if successful will turn on track changes for the docx.
private static void xmlSettings(WordprocessingMLPackage wordMLPackage) throws JAXBException
{
DocumentSettingsPart part = wordMLPackage.getMainDocumentPart().getDocumentSettingsPart();
String xml = XmlUtils.marshaltoString(part.getJaxbElement(), true);
xml = xml.replaceAll("<w:defaultTabStop w:val=\"720\" />", "<w:trackRevisions /><w:defaultTabStop w:val=\"720\" />");//Turns ...