/** * Return this child's owning document or null if the branch containing * this child is currently not attached to a document. * * @return this child's owning document or null if none */ public Document getDocument() { if (parent == null) return null; return parent.getDocument(); }