Recently, XML Schema Definition (XSD) has become ever more important when it comes to define programming language independent content models and type systems. However, writing software that operates on XML instance documents still suffers from a lack of compile time support for XSD. Especially, obeying facet based constraints imposed on XSD simple data types is still error prone and laborious. This paper introduces the concept of XSD aware compilation. Zhi# provides static- and dynamic type checking for XML simple data types, which can be used along with off-the-shelf implementations of the W3C XML DOM.