OdfOfficeStyles styles = textDoc.getOrCreateDocumentStyles();
StyleDefaultStyleElement def = styles.newStyleDefaultStyleElement("text");
def.setStyleFamilyAttribute(OdfStyleFamily.Paragraph.toString());
def.setProperty(StyleTextPropertiesElement.TextUnderlineColor, "#00FF00");
StyleStyleElement parent = styles.newStyleStyleElement("text","TheParent");
parent.setStyleFamilyAttribute(OdfStyleFamily.Paragraph.toString());
parent.setProperty(StyleTextPropertiesElement.FontSize, "17pt");
parent.setProperty(StyleTextPropertiesElement.Color, "#FF0000");
OdfStylesDom stylesDom = textDoc.getStylesDom();
XPath xpath = stylesDom.getXPath();
StyleStyleElement styleTest = (StyleStyleElement) xpath.evaluate("//style:style[last()]", stylesDom, XPathConstants.NODE);
Assert.assertEquals(styleTest, parent);
textDoc.save(ResourceUtilities.newTestOutputFile("CreatChildrenForStyles.odt"));
} catch (Exception e) {
Logger.getLogger(CreateChildrenElementsTest.class.getName()).log(Level.SEVERE, e.getMessage(), e);