def XML(uri, tc, ps, **keywords):
source = urllib.request.urlopen(uri, **keywords)<EOL>enc = source.info().getencoding()<EOL>if enc in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>data = source<EOL><DEDENT>else:<EOL><INDENT>data = StringIO.StringIO()<EOL>mimetools.decode(source, data, enc)<EOL>data.seek(<NUM_LIT:0>)<EOL><DEDENT>dom = ps.readerclass().fromStream(data)<EOL>return _child_elements(dom)[<NUM_LIT:0>]<EOL>
Resolve a URI and return its content as an XML DOM.