/** {@inheritDoc} */
public ContentHandler getImportContentHandler(
final String path, final int mode) throws RepositoryException {
try {
final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
return new DefaultContentHandler(
SerializingContentHandler.getSerializer(buffer)) {
public void endDocument() throws SAXException {
super.endDocument();
try {
remote.importXML(path, buffer.toByteArray(), mode);