String path_in = System.getProperty("user.dir") + "/src/test/resources/parts/";
// Need to know how what type of part to map to
InputStream in = new FileInputStream(path_in + "[Content_Types].xml");
ContentTypeManager externalCtm = new ContentTypeManager();
externalCtm.parseContentTypesFile(in);
// Example of a part which become a rel of the word document
in = new FileInputStream(path_in + "settings.xml");
attachForeignPart(wordMLPackage, wordMLPackage.getMainDocumentPart(),
externalCtm, "word/settings.xml", in);