The Extensible Markup Language (XML) is the de facto standard for the interoperable document format. The XML has a node-labeled tree structure. A major field of research in my PhD is applying tree automata (TA) for querying of XML documents in a database (DB). In the recent years several tree automata methods for querying of node-labeled trees has been suggested. The class of queries, which these automata express, is equivalent to the class of queries that is expressed by monadic second-order formulas. In the lecture I will scketch a new restricted TA for unordered labeled (UUTA) trees and a new methodology that queries tree automata rather then trees. The lecture presents several applications of UUTA for XML and semi-structured in a DB. The applications include: structural-join, structural-index and induction of TA form trees. Other fields of research in my PhD involve XML and compression. These fields are: a.. XML streaming parser API for smart cards clients; b.. A method for byte-wise processing of Universal Codes; c.. XML grammar-based compression. I will talk about them in the second part of lecture.