protected Element _parse(String value, IRI baseUri) throws ParseException, UnsupportedEncodingException {
if (value == null)
return null;
FOMFactory fomfactory = (FOMFactory)factory;
Parser parser = fomfactory.newParser();
ByteArrayInputStream bais =
new ByteArrayInputStream(value.getBytes(getXMLStreamReader().getCharacterEncodingScheme()));
ParserOptions options = parser.getDefaultParserOptions();
options.setCharset(getXMLStreamReader().getCharacterEncodingScheme());
options.setFactory(fomfactory);
Document doc = parser.parse(bais, (baseUri != null) ? baseUri.toString() : null, options);
return doc.getRoot();
}