String refText;
try {
Document doc = this.builder.newDocument();
Node element = ref.toXML(doc);
doc.appendChild(element);
refText = DOMUtils.toString((Element) element, true, true);
} catch (Exception ex) {
throw new HibernateException("Cannot disassemble ref.", ex);