fix PHPCR-98 and allow replacing child documents

/cc @dbu @elhornair