# File lib/aws/xml_grammar.rb, line 125
      def parse xml, options = {}

        context = options[:context] || Context.new

        if defined? Nokogiri
          parser = Parser.new(context, customizations)
          parser.extend(NokogiriAdapter)
          xml = "<foo/>" if xml.empty?
          Nokogiri::XML::SAX::Parser.new(parser).parse(xml.strip)
        else
          parser = Parser.new(context, customizations)
          parser.extend(REXMLSaxParserAdapter)
          REXML::Parsers::StreamParser.new(REXML::Source.new(xml), parser).parse
        end

        context

      end