Legacy XML parser & tree handling utilities