We present new X-ray observations of the optically obscured protostar HL Tau and the intermediate-mass Herbig Be star HD 100546. Both objects are surrounded by spectacular disks showing complex morphology, including rings and gaps that may have been sculpted by protoplanets. HL Tau was detected as a variable hard X-ray source by Chandra, typical of late-type magnetically active coronal sources. No extended X-ray emission was seen along the HL Tau jet, or along the jet of the T Tauri binary system XZ Tau located 23″ to its east. In contrast, HD 100546 was detected by XMM-Newton as a soft X-ray source (kT ≲ 1 keV) with no short-term (<1 day) variability. Its X-ray properties are remarkably similar to the Herbig stars AB Aur and HD 163296, strongly suggesting that their X-ray emission arises from the same mechanism and is intrinsic to the Herbig stars themselves, not due to unseen late-type companions. We consider several possible emission mechanisms and conclude that the X-ray properties of HD 100546 are consistent with an accretion shock origin, but higher resolution grating spectra capable of providing information on individual emission lines are needed to more reliably distinguish between accretion shocks and alternatives. We show that X-ray ionization and heating are mainly confined to the upper disk layers in both HL Tau and HD 100546, and any exoplanets near the midplane at distances ≥1 au are well-shielded from X-rays produced by the central star.