subroutine dump_xc_info(xf,p)
use xmlf90_wxml
type(xmlf_t), intent(inout) :: xf
type(xc_t), intent(in) :: p
integer :: i
call xml_NewElement(xf,"exchange-correlation")
call dump_annotation(xf,p%annotation)
call xml_NewElement(xf,"libxc-info")
call my_add_attribute(xf,"number-of-functionals",str(p%n_functs_libxc))
do i = 1, p%n_functs_libxc
call xml_NewElement(xf,"functional")
call my_add_attribute(xf,"name",trim(p%libxc_name(i)))
if (trim(p%libxc_type(i)) /= "UNKNOWN") then
call my_add_attribute(xf,"type",trim(p%libxc_type(i)))
endif
call my_add_attribute(xf,"id",str(p%libxc_id(i)))
if (p%libxc_weight(i) /= 1.0_dp) then
call my_add_attribute(xf,"weight",str(p%libxc_weight(i)))
endif
call xml_EndElement(xf,"functional")
enddo
call xml_EndElement(xf,"libxc-info")
call xml_EndElement(xf,"exchange-correlation")
end subroutine dump_xc_info