try {
DocumentBuilder db = DomUtil.BUILDER_FACTORY.newDocumentBuilder();
Document doc = db.parse(in);
Element prop = DomUtil.getChildElement(doc, ItemResourceConstants.JCR_VALUES.getName(), ItemResourceConstants.JCR_VALUES.getNamespace());
DavProperty<?> p = DefaultDavProperty.createFromXml(prop);
ValuesProperty vp = new ValuesProperty(p, PropertyType.BINARY, vf);
Value[] jcrVs = vp.getJcrValues();
init(jcrVs[index].getStream(), true);
} catch (RepositoryException e) {
throw new IOException(e.getMessage());
}catch (DavException e) {
throw new IOException(e.getMessage());