Update AppConfig.php

xpath support and a bug fix