Static Analysis of XML Programs