public boolean getMustPreserveWhitespace() { OMAttribute attr = getAttribute(SPACE); String space = (attr != null) ? attr.getAttributeValue() : null; Base parent = this.getParentElement(); return space != null && space.equalsIgnoreCase("preserve") ? true : (parent != null && parent instanceof Element) ? ((Element)parent).getMustPreserveWhitespace() : (parent != null && parent instanceof Document) ? ((Document)parent).getMustPreserveWhitespace() : true; }