'Factory using an options dictionary.
Args:
options: Dictionary of options. Must contain:
* xpath_to_nodes: The xpath to select a record.
* style: \'element_centric\' or \'attribute_centric\'
name: The name of this transformer, for use in error messages.
Returns:
XmlConnector connector object described by the specified options.
Raises:
InvalidConfiguration: If the config is invalid.'

@classmethod
def create_from_options(cls, options, name):

    xpath_to_nodes = options.get('xpath_to_nodes')
    if (not xpath_to_nodes):
        raise bulkloader_errors.InvalidConfiguration(('simplexml    must    specify    xpath_to_nodes.    (In    transformer    named    %s)' % name))
    if (not re.match(NODE_PATH_ONLY_RE, xpath_to_nodes)):
        logging.warning('simplexml    export    only    supports    very    simple    /root/to/node    xpath_to_nodes    for    now.')
    xml_style = options.get('style')
    xml_style_mapping = {'element_centric': cls.ELEMENT_CENTRIC, 'attribute_centric': cls.ATTRIBUTE_CENTRIC}
    if (xml_style not in xml_style_mapping):
        raise bulkloader_errors.InvalidConfiguration(('simplexml    must    specify    one    of    these    valid    xml_style    options:    "%s".    You    specified    %s    in    transformer    named    %s.' % ('",    "'.join(xml_style_mapping.keys()), xml_style, name)))
    return cls(xpath_to_nodes, xml_style_mapping[xml_style])
