<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>eew... why not:
&lt;pre&gt;
// ==UserScript==
// @name           IRCTC : Quick Book
// @namespace      http://gm.wesley.eti.br/irctc
// @description    Submits the form after the payment option be chosen
// @include        https://www.irctc.co.in/cgi-bin/bv60.dll/irctc/booking/quickBook.do?*
// ==/UserScript==
document.evaluate('//select[@name=&quot;gatewayID&quot;]', document, null, 9, null).singleNodeValue.addEventListener('change',function(e)
{
	e.target.form.elements.namedItem('Submit').click();
}, false);
&lt;/pre&gt;

?

The XPathResult types are really just integer constants. &lt;code&gt;XPathResult.ANY_UNORDERED_NODE_TYPE&lt;/code&gt; is equal to 8. But I chose 9 since this is a &lt;code&gt;singleNodeValue&lt;/code&gt; return type.</body>
  <body-html>&lt;p&gt;eew... why not:
&lt;br /&gt;&lt;pre&gt;
// ==UserScript==
// @name           IRCTC : Quick Book
// @namespace      http://gm.wesley.eti.br/irctc
// @description    Submits the form after the payment option be chosen
// @include        https://www.irctc.co.in/cgi-bin/bv60.dll/irctc/booking/quickBook.do?*
// ==/UserScript==
document.evaluate('//select[@name=&quot;gatewayID&quot;]', document, null, 9, null).singleNodeValue.addEventListener('change',function(e)
{
	e.target.form.elements.namedItem('Submit').click();
}, false);
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;?&lt;/p&gt;

&lt;p&gt;The XPathResult types are really just integer constants. &lt;code&gt;XPathResult.ANY_UNORDERED_NODE_TYPE&lt;/code&gt; is equal to 8. But I chose 9 since this is a &lt;code&gt;singleNodeValue&lt;/code&gt; return type.&lt;/p&gt;</body-html>
  <created-at type="datetime">2008-11-08T18:01:35Z</created-at>
  <forumable-id type="integer">2</forumable-id>
  <forumable-type>Forum</forumable-type>
  <id type="integer">17288</id>
  <topic-id type="integer">9596</topic-id>
  <updated-at type="datetime">2008-11-08T18:03:43Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">61251</user-id>
</post>
