The semantic web is supposed to become a characteristic phenomenon of the worldwide web in the next decade. One of the basic semantic web tools is the XML language. The aim of this paper is to provide information on how web documents written in the XML language can be rewritten into logic forms expressed as Prolog/Datalog programs. The XML language constitutes the basis of many semantic web languages and information in XML documents is usually retrieved with the help of procedural language called XQuery. Retrieving based on logic formulas gives us the chance to take advantage of deduction and this way to gain new originally hidden information.