public boolean marshal(MarshalRecord marshalRecord, Object object, AbstractSession session, NamespaceResolver namespaceResolver, XMLMarshaller marshaller, MarshalContext marshalContext) {
if ((null == marshalNodeValue) || marshalNodeValue.isMarshalOnlyNodeValue()) {
marshalRecord.addGroupingElement(this);
boolean hasValue = false;
if (null != attributeChildren) {
for (int x = 0, size = attributeChildren.size(); x < size; x++) {
XPathNode xPathNode = attributeChildren.get(x);
hasValue = xPathNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, ObjectMarshalContext.getInstance()) || hasValue;
}
}
if (anyAttributeNode != null) {
hasValue = anyAttributeNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, ObjectMarshalContext.getInstance()) || hasValue;
}
if (null != nonAttributeChildren) {
for (int x = 0, size = marshalContext.getNonAttributeChildrenSize(this); x < size; x++) {
XPathNode xPathNode = (XPathNode)marshalContext.getNonAttributeChild(x, this);
MarshalContext childMarshalContext = marshalContext.getMarshalContext(x);
hasValue = xPathNode.marshal(marshalRecord, object, session, namespaceResolver, marshaller, childMarshalContext) || hasValue;
}
}
if (hasValue) {
marshalRecord.endElement(xPathFragment, namespaceResolver);
} else {
marshalRecord.removeGroupingElement(this);
}
return hasValue;
} else {
return marshalContext.marshal(marshalNodeValue, xPathFragment, marshalRecord, object, session, namespaceResolver);
}
}